-
Notifications
You must be signed in to change notification settings - Fork 8
55 lines (45 loc) · 1.46 KB
/
deploy-prod.yml
File metadata and controls
55 lines (45 loc) · 1.46 KB
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: Deploy to GitHub Pages
on:
push:
tags:
- "v*"
concurrency:
group: deploy-gh-pages
cancel-in-progress: true
permissions:
contents: write
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "24"
cache: "npm"
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm install
- name: Test
run: npm test
- name: Build
run: npm run build -- --base=/ftw-inference-app/
env:
VITE_API_BASE_URL: ${{ secrets.VITE_API_BASE_URL }}
- name: Configure git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Deploy to /
run: |
git fetch origin gh-pages
git worktree add /tmp/gh-pages gh-pages
find /tmp/gh-pages -maxdepth 1 -mindepth 1 ! -name 'dev' ! -name '.git' -exec rm -rf {} +
cp -r ftw-inference-app/. /tmp/gh-pages/
touch /tmp/gh-pages/.nojekyll
git -C /tmp/gh-pages add -A
git -C /tmp/gh-pages diff --staged --quiet || git -C /tmp/gh-pages commit -m "Deploy ${{ github.ref_name }}"
git -C /tmp/gh-pages push origin gh-pages
git worktree remove /tmp/gh-pages