-
Notifications
You must be signed in to change notification settings - Fork 2
60 lines (49 loc) · 1.48 KB
/
static.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Build and Deploy content pages to GitHub Pages
on:
push:
branches:
- master # Trigger on push to the 'main' branch
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: install and test
run: |
npm install -g yarn
npm install -g gulp
yarn install
gulp build # to do: we should make this run by `npm test`
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: ./build # Adjust this path based on your build output directory
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' # Deploy only on the main branch
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: ./build # Adjust this path based on your build output directory
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build # The directory to deploy (output of the build)