-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.42 KB
/
deploy.yml
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
name: Deploy to itch.io
on:
workflow_call:
inputs:
# Example: sajmoni/foo:web
game_name:
required: true
type: string
secrets:
BUTLER_API_KEY:
required: true
env:
NODE_VERSION: 22
jobs:
deploy:
name: Build game
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Use Node.js $NODE_VERSION
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Install Butler
run: |
curl --max-time 5 -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
- name: Deploy to itch.io
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
run: ./butler push dist ${{ inputs.game_name }}
- name: Set git information
run: |
git config --global user.name 'Github Actions [bot]'
git config --global user.email 'github-actions@not-a-real-email.com'
- name: Increase version
run: npm version patch
# TODO: This will fail if someone else pushes changes to main
- name: Push back to repository
run: |
git push origin --tags
git push