-
Notifications
You must be signed in to change notification settings - Fork 25
60 lines (58 loc) · 2.19 KB
/
Copy pathdeploy.yml
File metadata and controls
60 lines (58 loc) · 2.19 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
name: deploy
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: 'npm'
- run: npm install
- run: npm audit --audit-level=moderate || true
- name: Create placeholder keys for tests
run: cp src/environments/keys.example.ts src/environments/keys.ts
- name: Cache manifest data
uses: actions/cache@v4
with:
path: |
tools/manifest/.cache
src/assets/destiny2-*.json
key: manifest-v1-${{ hashFiles('src/assets/destiny2-version.json') }}
restore-keys: manifest-v1-
- name: Fetch Bungie manifest
run: npm run manifest:fetch
env:
BUNGIE_API_KEY: ${{ secrets.API_KEY }}
- run: npm run test:ci
- run: npm run stage-prod-keys
env:
PROD_API_KEY: ${{ secrets.API_KEY }}
PROD_CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
PROD_DIM_API_KEY: ${{ secrets.DIM_API_KEY }}
- run: npx ng build --configuration production
- name: Deploy via rsync
env:
SSH_KEY: ${{ secrets.SSH }}
run: |
mkdir -p ~/.ssh
echo "$SSH_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
# Two-phase deploy so clients never load the new index.html (and the new
# ?v= asset URLs baked into it) before every asset it references is fully
# uploaded. A request for a new-versioned URL mid-upload returns the OLD
# file, which Cloudflare then caches for 30 days under the NEW cache key,
# poisoning the manifest for every client (see missing-guns bug, Jun 2026).
rsync -avz --exclude=index.html \
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no -p ${{ secrets.PORT }}" \
./dist/browser/ \
${{ secrets.UID }}@${{ secrets.HOST }}:/home/${{ secrets.UID }}/d2checklist/
rsync -avz --delete \
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no -p ${{ secrets.PORT }}" \
./dist/browser/ \
${{ secrets.UID }}@${{ secrets.HOST }}:/home/${{ secrets.UID }}/d2checklist/
rm -f ~/.ssh/deploy_key