Skip to content

Commit fef41d7

Browse files
committed
📄 Add GitHub Actions workflow for CI/CD deployment to GitHub Pages
1 parent 2887f65 commit fef41d7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
3+
4+
name: Deploy CI
5+
permissions:
6+
id-token: write
7+
pages: write
8+
9+
on:
10+
push:
11+
branches: [ "master" ]
12+
pull_request:
13+
branches: [ "master" ]
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
- name: Use Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '18.x'
25+
- name: Build static files
26+
id: build
27+
run: |
28+
npm install
29+
npm run build
30+
- name: Upload static files as artifact
31+
id: deployment
32+
uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: dist/
35+
36+
deploy:
37+
environment:
38+
name: github-pages
39+
url: ${{ steps.deployment.outputs.page_url }}
40+
runs-on: ubuntu-latest
41+
needs: build
42+
steps:
43+
- name: Deploy to GitHub Pages
44+
id: deployment
45+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)