Skip to content

Commit

Permalink
🚦 Add doc verification to promotion
Browse files Browse the repository at this point in the history
The `docs.yaml` workflow was not previously set up to be triggered
as part of the `promote` workflow. This isn't, strictly speaking,
"bad" -- but the lack of this does prevent catching workflow issues
earlier.

This modifies the `docs.yaml` workflow to now have a mode that skips
publishing that, and reuses this workflow as part of the promotion
process.
  • Loading branch information
bitwizeshift committed Dec 15, 2023
1 parent 040d73d commit 8fc71ce
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ on:
push:
branches: [master]
workflow_dispatch:
workflow_call:
inputs:
skip-publish:
default: false
description: "Creates the documentation in this workflow without publishing"
required: false
type: boolean

jobs:
generate:
Expand Down Expand Up @@ -61,6 +68,7 @@ jobs:
find ./target -type d -exec chmod 0755 {} \;
- name: Upload Pages Artifact
if: inputs.skip-publish != true
uses: actions/upload-pages-artifact@v1
with:
path: ./target/doc
Expand All @@ -82,10 +90,11 @@ jobs:
steps:
- name: Upload GH Pages
id: deployment
if: inputs.skip-publish != true
uses: actions/deploy-pages@v1

- name: Create summary
if: success()
if: success() && inputs.skip-publish != true
run: |
echo "# Documentation successfully deployed 🚀" >> "${GITHUB_STEP_SUMMARY}"
echo "" >> "${GITHUB_STEP_SUMMARY}"
Expand Down
18 changes: 14 additions & 4 deletions .github/workflows/promote.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,30 @@ concurrency:
cancel-in-progress: true

jobs:
verify:
verify-build:
name: Verify build integrity
uses: ./.github/workflows/build.yaml
permissions:
contents: read
security-events: write
actions: read

verify-docs:
name: Verify documentation
uses: ./.github/workflows/docs.yaml
permissions:
contents: read
pages: write
id-token: write
with:
skip-publish: true

promote:
name: Promote to Master
runs-on: ubuntu-latest
environment: master
if: success()
needs:
- verify
needs: [verify-build, verify-docs]
steps:
- name: Checkout develop
uses: actions/checkout@v3
Expand All @@ -51,7 +60,7 @@ jobs:
sha1=$(git rev-parse --short HEAD)
echo '# ⏩ Accepted changes from `develop` into `master`' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
echo '${{github.sha}} is the new HEAD of `master`' >> "${GITHUB_STEP_SUMMARY}"
echo '[${{github.sha}}] is the new HEAD of `master`' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
echo '## Summary' >> "${GITHUB_STEP_SUMMARY}"
echo '' >> "${GITHUB_STEP_SUMMARY}"
Expand All @@ -67,6 +76,7 @@ jobs:
--pretty='format:| [`%h`](https://github.com/${{github.repository}}/commit/%h) | %s |' \
--no-show-signature \
${old_sha1}..${new_sha1} >> "${GITHUB_STEP_SUMMARY}"
echo '[${{github.sha}}]: https://github.com/${{github.repository}}/commit/${{github.sha}}' >> "${GITHUB_STEP_SUMMARY}"
- name: Summarize Failure
if: failure()
Expand Down

0 comments on commit 8fc71ce

Please sign in to comment.