Skip to content

Commit 13a22a0

Browse files
committed
Enhance GitHub Actions workflows for deployment and notifications
Updated the static.yml workflow to trigger on the successful completion of the pages.yml workflow. Added permissions for content and pages management, and included a conditional check to ensure the deploy job only runs if the previous workflow succeeded. Added a notification message in pages.yml to confirm changes have been pushed.
1 parent 39acc09 commit 13a22a0

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.github/workflows/pages.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,6 @@ jobs:
4949
else
5050
git commit -m "Auto-update HTML report and assets"
5151
git push origin HEAD:main
52+
echo "Changes pushed. The static.yml workflow should now deploy to GitHub Pages."
5253
fi
5354

.github/workflows/static.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ on:
77
branches: ["main"]
88
paths:
99
- 'docs/**'
10+
11+
# Also trigger when pages.yml workflow completes successfully
12+
workflow_run:
13+
workflows: ["Generate and Deploy to GitHub Pages"]
14+
types:
15+
- completed
16+
branches: ["main"]
1017

1118
# Allows you to run this workflow manually from the Actions tab
1219
workflow_dispatch:
@@ -26,10 +33,16 @@ concurrency:
2633
jobs:
2734
# Single deploy job since we're just deploying
2835
deploy:
36+
# Only run if the triggering workflow completed successfully (if triggered by workflow_run)
37+
if: github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' || github.event_name != 'workflow_run'
2938
environment:
3039
name: github-pages
3140
url: ${{ steps.deployment.outputs.page_url }}
3241
runs-on: ubuntu-latest
42+
permissions:
43+
contents: read
44+
pages: write
45+
id-token: write
3346
steps:
3447
- name: Checkout
3548
uses: actions/checkout@v4

0 commit comments

Comments
 (0)