Skip to content

Commit 9ea0099

Browse files
Add GitHub Pages deploy job to CI workflow
1 parent 4e4c9bb commit 9ea0099

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

.github/workflows/actions.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ on:
88
branches:
99
- main
1010

11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: pages
18+
cancel-in-progress: false
19+
1120
jobs:
1221
build:
1322
runs-on: ubuntu-latest
@@ -39,3 +48,27 @@ jobs:
3948
cache: npm
4049
- run: npm ci
4150
- run: npm run check
51+
52+
deploy:
53+
needs: [build, check]
54+
runs-on: ubuntu-latest
55+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
steps:
60+
- uses: actions/checkout@v4
61+
- name: Use Node.js 22
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: 22
65+
cache: npm
66+
- run: npm ci
67+
- run: npm run build
68+
- name: Upload Pages artifact
69+
uses: actions/upload-pages-artifact@v3
70+
with:
71+
path: dist
72+
- name: Deploy to GitHub Pages
73+
id: deployment
74+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)