-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (52 loc) · 1.85 KB
/
Copy pathdeploy-cloudflare-pages.yml
File metadata and controls
60 lines (52 loc) · 1.85 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 Cloudflare Pages
on:
workflow_dispatch:
push:
branches:
- main
concurrency:
group: cloudflare-pages-deploy
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
env:
CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 24
- name: Validate Cloudflare Pages config
env:
CF_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CF_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CF_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT }}
run: |
test -n "$CF_API_TOKEN" || { echo "Missing GitHub secret: CLOUDFLARE_API_TOKEN"; exit 1; }
test -n "$CF_ACCOUNT_ID" || { echo "Missing GitHub secret: CLOUDFLARE_ACCOUNT_ID"; exit 1; }
test -n "$CF_PAGES_PROJECT" || { echo "Missing GitHub repository variable: CLOUDFLARE_PAGES_PROJECT"; exit 1; }
if [ "$CF_PAGES_PROJECT" != "osdhack" ]; then
echo "Expected CLOUDFLARE_PAGES_PROJECT=osdhack, got: $CF_PAGES_PROJECT"
exit 1
fi
- name: Prepare static bundle
run: |
rm -rf dist
mkdir -p dist
cp index.html dist/
cp rulebook.pdf dist/
cp resourcebook.pdf dist/
cp stream10jul.pdf dist/
cp -R assets css js multiplayer register rulebook dist/
- name: Deploy to Cloudflare Pages
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
wranglerVersion: "4.103.0"
command: pages deploy dist --project-name=${{ vars.CLOUDFLARE_PAGES_PROJECT }}