-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (44 loc) · 1.28 KB
/
build.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
name: Build and Deploy
on:
push:
branches:
- main
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '22'
cache: 'npm'
- name: Version
run: |
BASE_VERSION=$(npm run get-version --silent)
# Remove last digit and dot, then append run number
VERSION=$(echo $BASE_VERSION | sed 's/\.[0-9]*$/.'${{ github.run_number }}/)
echo "VERSION=$VERSION" >> $GITHUB_ENV
shell: bash
- name: Update package.json version
run: npm version $VERSION --no-git-tag-version
shell: bash
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Copy index.html to 404.html
run: cp dist/angor-hub/browser/index.html dist/angor-hub/browser/404.html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist/angor-hub/browser'
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4