Tweaks to CI. #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Plugin | |
on: | |
push: | |
branches: [ 'main' ] | |
pull_request: | |
branches: [ 'main' ] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
# Build the plugin | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ruby/[email protected] | |
with: | |
ruby-version: '3.3' | |
- run: gem build *.gemspec | |
- name: Upload to GitHub Artifacts | |
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b | |
with: | |
name: gemfile | |
path: "*.gem" | |
# Deploy to RubyGems | |
deploy: | |
permissions: | |
contents: write | |
id-token: write | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 | |
with: | |
name: gemfile | |
- name: Deploy to GitHub Pages | |
env: | |
RUBYGEMS_TOKEN: ${{ secrets.rubygems_token }} | |
run: GEM_HOST_API_KEY="$RUBYGEMS_TOKEN" gem push jekyll-csp*.gem |