-
Notifications
You must be signed in to change notification settings - Fork 33
69 lines (61 loc) · 2.16 KB
/
deploy-web.yml
File metadata and controls
69 lines (61 loc) · 2.16 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Deploy Web
# Build the static web app and publish it to the `acp-ui/acp-ui.github.io`
# repository, which GitHub Pages serves at https://acp-ui.github.io/.
#
# Auth: fine-grained PAT (PAGES_PUSH_TOKEN). The PAT is scoped to a single
# repository (acp-ui/acp-ui.github.io) with `Contents: Read and write` and
# no other permissions. Pushes happen over HTTPS, which is simpler than
# SSH on the runner and avoids the silent SSH handshake hang we saw with
# deploy keys.
on:
push:
branches:
- main
# Only rebuild when something that affects the web bundle changes.
paths:
- 'src/**'
- 'public/**'
- 'index.html'
- 'package.json'
- 'package-lock.json'
- 'tsconfig.json'
- 'tsconfig.node.json'
- 'vite.config.ts'
- '.github/workflows/deploy-web.yml'
# Allow re-deploying without a code change (e.g. after rotating the key
# or reconfiguring the Pages repo).
workflow_dispatch:
# Avoid concurrent deploys racing each other; the latest commit wins.
concurrency:
group: deploy-web
cancel-in-progress: true
jobs:
build-and-deploy:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: lts/*
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build web bundle
run: npm run build:web
- name: Deploy to acp-ui.github.io
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ secrets.PAGES_PUSH_TOKEN }}
external_repository: acp-ui/acp-ui.github.io
publish_branch: main
publish_dir: ./dist-web
# Keep the artifact repo's history one-commit shallow — the
# source of truth is this repo, not the deployed bundle.
force_orphan: true
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
commit_message: 'deploy: ${{ github.repository }}@${{ github.sha }}'