-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1013 Bytes
/
deploy_page.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Build and Deploy to GitHub Pages
on:
workflow_dispatch:
push:
branches:
- '*' # Trigger on all branches'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'
- name: Build project
run: |
npm ci
npm run build-ci
- name: Upload build artifacts
uses: actions/upload-pages-artifact@v3 # This stores the build output
with:
path: build
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
# Only deploy on main branch
if: github.ref == 'refs/heads/main'
permissions:
pages: write # Allows deployment to GitHub Pages
id-token: write # Needed for GitHub Pages deployment
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4 # This deploys the stored artifacts