mirror of
https://github.com/d4rken-org/capod.git
synced 2026-09-16 11:16:12 -04:00
chore(ci): Chain Pages deploy from release-tag.yml and adopt org refinements
release: published events triggered by secrets.GITHUB_TOKEN do not start new workflow runs (only workflow_dispatch and repository_dispatch are exceptions). The Pages workflow's release: published trigger would never have fired in production since release-tag.yml's softprops/action-gh-release uses GITHUB_TOKEN to publish. Fix: drop the release: published trigger and have release-tag.yml's release-github job explicitly run gh workflow run pages.yml --ref main after the release is created. release-github gains actions: write to authorize the dispatch. Also adopts refinements from sibling org PRs (permission-pilot#356, bluemusic#220): - Top-level permissions reduced to contents: read; pages: write and id-token: write moved to the deploy job only (least privilege) - JEKYLL_GITHUB_TOKEN on the build step so jekyll-github-metadata authenticates when fetching site.github.releases - Sanity-check step (test -f _site/index.html && _site/CNAME) fails fast if Jekyll produced nothing - Explicit upload-pages-artifact path: ./_site matches the build's destination - Verify fastlane Bundler wiring step (bundle exec fastlane --version) lets workflow_dispatch dry_run=true exercise the relocated Gemfile before the next real release
This commit is contained in:
@@ -1,14 +1,10 @@
|
|||||||
name: Deploy GitHub Pages
|
name: Deploy GitHub Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
|
||||||
types: [ published ]
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: pages
|
group: pages
|
||||||
@@ -32,14 +28,24 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
source: ./
|
source: ./
|
||||||
destination: ./_site
|
destination: ./_site
|
||||||
|
env:
|
||||||
|
JEKYLL_GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Sanity-check Jekyll output
|
||||||
|
run: test -f _site/index.html && test -f _site/CNAME
|
||||||
|
|
||||||
- name: Upload Pages artifact
|
- name: Upload Pages artifact
|
||||||
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 #v5.0.0
|
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 #v5.0.0
|
||||||
|
with:
|
||||||
|
path: ./_site
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to GitHub Pages
|
name: Deploy to GitHub Pages
|
||||||
needs: build
|
needs: build
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ jobs:
|
|||||||
name: Create GitHub release
|
name: Create GitHub release
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
actions: write
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
environment: foss-production
|
environment: foss-production
|
||||||
steps:
|
steps:
|
||||||
@@ -83,6 +84,12 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Trigger GitHub Pages deployment
|
||||||
|
if: "!(github.event_name == 'workflow_dispatch' && inputs.dry_run)"
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: gh workflow run pages.yml --ref main
|
||||||
|
|
||||||
release-gplay:
|
release-gplay:
|
||||||
name: Create Google Play release
|
name: Create Google Play release
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
@@ -126,6 +133,9 @@ jobs:
|
|||||||
bundler-cache: true
|
bundler-cache: true
|
||||||
working-directory: fastlane
|
working-directory: fastlane
|
||||||
|
|
||||||
|
- name: Verify fastlane Bundler wiring
|
||||||
|
run: bundle exec fastlane --version
|
||||||
|
|
||||||
- name: Assemble beta and upload to Google Play
|
- name: Assemble beta and upload to Google Play
|
||||||
if: contains(github.ref_name, '-beta') && !(github.event_name == 'workflow_dispatch' && inputs.dry_run)
|
if: contains(github.ref_name, '-beta') && !(github.event_name == 'workflow_dispatch' && inputs.dry_run)
|
||||||
run: bundle exec fastlane beta
|
run: bundle exec fastlane beta
|
||||||
|
|||||||
Reference in New Issue
Block a user