Skip to content

Commit 9c63856

Browse files
committed
Github actions
1 parent 74039c1 commit 9c63856

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/main.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [ master, dev ]
6+
pull_request:
7+
branches: [ master, dev ]
8+
9+
workflow_dispatch:
10+
11+
jobs:
12+
build:
13+
name: Build
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
23+
- name: Run install
24+
run: npm install
25+
26+
- name: Build site
27+
run: npm run build
28+
29+
- name: Upload artifact
30+
uses: actions/upload-pages-artifact@v3
31+
with:
32+
path: "_site/"
33+
34+
deploy:
35+
name: Deploy
36+
runs-on: ubuntu-latest
37+
needs: build
38+
if: github.ref == 'refs/heads/master' # Only deploy on push to master
39+
40+
permissions:
41+
pages: write
42+
id-token: write
43+
44+
environment:
45+
name: github-pages
46+
url: ${{ steps.deployment.outputs.page_url }}
47+
48+
steps:
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)