Skip to content

Commit 13ebeb3

Browse files
Enhance CI workflow with deployment stage
Added deploy stage to GitHub Actions workflow for production deployment.
1 parent dae2668 commit 13ebeb3

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/build-test-deploy.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
node-version: '20.x'
1313
- run: npm install
1414
- run: npm run build
15+
1516
test:
1617
needs: build
1718
runs-on: ubuntu-latest
@@ -24,3 +25,36 @@ jobs:
2425
node-version: '20.x'
2526
- run: npm install
2627
- run: npm test
28+
29+
deploy:
30+
needs: test
31+
permissions:
32+
contents: write
33+
pages: write
34+
id-token: write
35+
environment:
36+
name: Production
37+
url: ${{ steps.deployment.outputs.page_url }}
38+
runs-on: ubuntu-latest
39+
steps:
40+
- name: checkout repo
41+
uses: actions/checkout@v4
42+
with:
43+
token: ${{ secrets.GITHUB_TOKEN }}
44+
- name: Use node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: '20.x'
48+
- name: configure github pages
49+
uses: actions/configure-pages@v4
50+
with:
51+
static_site_generator: next
52+
- run: npm install
53+
- run: npm run build
54+
- name: upload artifacts
55+
uses: actions/upload-pages-artifact@v3
56+
with:
57+
path: './out'
58+
- name: deploy
59+
id: deployment
60+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)