-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (60 loc) · 2.31 KB
/
Copy pathdeploy.yml
File metadata and controls
69 lines (60 loc) · 2.31 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
permissions:
contents: read
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-latest
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
# A manual (workflow_dispatch) run checks out whatever ref the UI's
# branch/tag picker was left on — pin it onto the most recent tag so a
# manual test run always deploys the same thing a real tag push would.
- name: Pin to most recent tag (manual runs only)
if: github.event_name == 'workflow_dispatch'
run: |
latest_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)")
echo "Checking out most recent tag: $latest_tag"
git checkout "$latest_tag"
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: npm ci
# `build`'s own `prebuild` hook fetches the online WAD catalog (~170 MB,
# see onlineWadCatalog.ts) if not already present — same cache as the
# verify workflow, so a normal run restores from cache instead of
# re-downloading from 3 external hosts.
- name: Cache online WAD assets
uses: actions/cache@v6
with:
path: public/wads
key: online-wads-${{ hashFiles('src/wad/onlineWadCatalog.ts') }}
# VITE_MULTIPLAYER_SERVER_URL is baked in at build time (see
# doc/dev/multiplayer-deployment.md#2-client-build-pointed-at-the-signaling-server).
# Local production builds pick it up from the gitignored
# .env.production.local; CI has no such file, so it's hardcoded here
# instead — it's not a secret, it ends up in the public JS bundle
# either way. Without it the deployed build ships with multiplayer
# unconfigured (the Multiplayer tab silently hides itself).
- run: npm run build
env:
VITE_MULTIPLAYER_SERVER_URL: "https://mp.codeenstein3d.mcdope.org"
- name: Deploy to FTP
uses: SamKirkland/FTP-Deploy-Action@v4.4.0
with:
server: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }}
password: ${{ secrets.DEPLOY_PASS }}
protocol: ftps
local-dir: ./dist/
server-dir: ./