forked from alan-turing-institute/scivision
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.48 KB
/
frontend.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
name: Build frontend
on: [push, pull_request]
jobs:
build-and-deploy-if-main:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: catalog-validation
fetch-depth: 0
- name: Update branch
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git checkout main
git fetch origin
git checkout catalog-validation
git pull
git merge origin/main
git push origin catalog-validation
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install Scivision.Py
run: |
pip install .
- name: Install node packages
working-directory: frontend
run: npm ci
- name: Build
working-directory: frontend
run: npm run build && cp ./dist/index.html ./dist/404.html && cp ./CNAME ./dist/CNAME
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4.2.2
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: frontend/dist
clean: true