Repository navigation
104 lines (97 loc) · 3.06 KB
/
Copy pathdeploy.yml
File metadata and controls
104 lines (97 loc) · 3.06 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build and deploy
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Accessibility and keyboard tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run validate
- run: npx playwright install --with-deps chromium webkit
- run: npx playwright test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-results
path: test-results
retention-days: 7
build:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- run: npm run validate
- run: npm run build
- uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
with:
path: dist
deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
itch:
name: Publish to itch.io
if: github.event_name == 'push'
needs: test
runs-on: ubuntu-latest
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
steps:
- name: Check whether to publish
id: gate
env:
COMMIT_MSG: ${{ github.event.head_commit.message }}
run: |
if [ -z "$BUTLER_API_KEY" ]; then
echo "No BUTLER_API_KEY secret set; skipping itch.io publish."
echo "publish=false" >> "$GITHUB_OUTPUT"; exit 0
fi
# Game Off voting starts Dec 1, 2026 13:37 PST; after that only commits tagged [itch-fix] publish.
if [ "$(date -u +%s)" -ge "$(date -u -d '2026-12-01T21:37:00Z' +%s)" ] && [[ "$COMMIT_MSG" != *"[itch-fix]"* ]]; then
echo "Jam voting period: skipping. Add [itch-fix] to the commit message to publish a critical fix."
echo "publish=false" >> "$GITHUB_OUTPUT"; exit 0
fi
echo "publish=true" >> "$GITHUB_OUTPUT"
- uses: actions/checkout@v4
if: steps.gate.outputs.publish == 'true'
- uses: actions/setup-node@v4
if: steps.gate.outputs.publish == 'true'
with:
node-version: 22
cache: npm
- if: steps.gate.outputs.publish == 'true'
run: npm ci && npm run build
- name: Push build with butler
if: steps.gate.outputs.publish == 'true'
run: |
curl -sSfL -o butler.zip https://broth.itch.zone/butler/linux-amd64/LATEST/archive/default
unzip -q butler.zip -d butler-bin && chmod +x butler-bin/butler
./butler-bin/butler push dist izzygld/shift-tab:html5 --userversion "${GITHUB_SHA::7}"