-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (51 loc) · 1.69 KB
/
Copy pathdeploy.yml
File metadata and controls
56 lines (51 loc) · 1.69 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
# Builds src/content.gen.js from fresh clones of the source repos, tests, and
# deploys the worker. The generated corpus never enters git: every deploy
# regenerates it, so freshness = the newest run (push to main, the daily
# schedule, or a manual dispatch as the "deploy now" button).
name: Deploy
on:
push:
branches:
- main
schedule:
- cron: "43 3 * * *"
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
name: Build content and deploy
runs-on: ubuntu-latest
timeout-minutes: 15
# Production only ever ships main: workflow_dispatch accepts any ref, and
# without this a dispatch from a topic branch would deploy that branch.
if: github.ref == 'refs/heads/main'
concurrency:
group: deploy
cancel-in-progress: false
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: ./.github/actions/build
- name: Deploy
env:
ADMIN_TOKEN: ${{ secrets.WDL_DEPLOY_TOKEN }}
CONTROL_URL: ${{ vars.CONTROL_URL || 'api.wdl.dev' }}
WDL_TOKEN_STORE: "off"
run: |
if [ -z "$ADMIN_TOKEN" ]; then
echo "WDL_DEPLOY_TOKEN secret is required to deploy." >&2
exit 1
fi
npm run deploy
# Housekeeping, not part of the release: the deploy above is already live,
# so a failure here is surfaced without failing the run.
- name: Prune superseded versions
continue-on-error: true
env:
ADMIN_TOKEN: ${{ secrets.WDL_DEPLOY_TOKEN }}
CONTROL_URL: ${{ vars.CONTROL_URL || 'api.wdl.dev' }}
WDL_TOKEN_STORE: "off"
WDL_NS: site
run: npm run prune