-
Notifications
You must be signed in to change notification settings - Fork 3
71 lines (58 loc) · 1.92 KB
/
Copy pathpublish-assets-production.yml
File metadata and controls
71 lines (58 loc) · 1.92 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
70
71
name: Publish Documentation Assets Production
on:
push:
branches:
- main
permissions:
contents: read
concurrency:
group: autonomi-worker-production
cancel-in-progress: false
jobs:
publish-assets:
name: Publish complete documentation asset set
runs-on: ubuntu-latest
if: vars.AUTOMATIC_PRODUCTION_PUBLICATION == 'enabled'
steps:
- name: Checkout exact push
uses: actions/checkout@v4
with:
ref: ${{ github.sha }}
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: worker/package-lock.json
- name: Install dependencies
working-directory: worker
run: npm ci
- name: Stage exact push assets for checks
working-directory: worker
run: npm run stage:assets -- "$GITHUB_SHA"
- name: Check worker and complete public set
working-directory: worker
run: npm run check
- name: Refresh network-current main
run: >-
git fetch --no-tags --force origin
+refs/heads/main:refs/remotes/origin/main
- name: Guard protected production baseline
working-directory: worker
env:
PRODUCTION_BASELINE_SHA: ${{ vars.PRODUCTION_BASELINE_SHA }}
run: >-
npm run guard:production --
"$PRODUCTION_BASELINE_SHA" "$GITHUB_SHA"
- name: Restage exact push assets after guard
working-directory: worker
run: npm run stage:assets -- "$GITHUB_SHA"
- name: Publish complete public set to production
working-directory: worker
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: >-
npm run deploy:production --
--message "Automatic production source commit $GITHUB_SHA"