File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Documentation to GitHub Pages
2+
3+ on :
4+ push :
5+ branches : [main]
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : read
10+ pages : write
11+ id-token : write
12+
13+ jobs :
14+ check-deploy :
15+ runs-on : ubuntu-latest
16+ outputs :
17+ should_deploy : ${{ steps.check.outputs.should_deploy }}
18+ steps :
19+ - name : Check commit message for [gh-pages]
20+ id : check
21+ run : |
22+ if [[ "${{ github.event.head_commit.message }}" == *"[gh-pages]"* ]] || [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
23+ echo "should_deploy=true" >> $GITHUB_OUTPUT
24+ else
25+ echo "should_deploy=false" >> $GITHUB_OUTPUT
26+ fi
27+
28+ build :
29+ needs : check-deploy
30+ if : needs.check-deploy.outputs.should_deploy == 'true'
31+ runs-on : ubuntu-latest
32+ steps :
33+ - name : Checkout
34+ uses : actions/checkout@v4
35+
36+ - name : Build with Astro
37+ uses : withastro/action@v2
38+ with :
39+ path : docs
40+
41+ deploy :
42+ needs : build
43+ runs-on : ubuntu-latest
44+ environment :
45+ name : github-pages
46+ url : ${{ steps.deployment.outputs.page_url }}
47+ steps :
48+ - name : Deploy to GitHub Pages
49+ id : deployment
50+ uses : actions/deploy-pages@v4
You can’t perform that action at this time.
0 commit comments