-
Notifications
You must be signed in to change notification settings - Fork 4.2k
104 lines (96 loc) · 3.33 KB
/
use-sdk.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
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: Processes changed character-sheets and updates CDN bucket and/or sheet-http database as needed
on:
push:
branches: ["staging"]
jobs:
changes:
runs-on: ubuntu-latest
# Set job outputs to values from filter step
outputs:
sheet: ${{ steps.filter.outputs.sheet }}
sheet-json: ${{ steps.filter.outputs.sheet_files }}
force-update: ${{ steps.filter.outputs.force-update }}
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v2
id: filter
with:
# Enable listing of files matching each filter.
# Paths to files will be available in `${FILTER_NAME}_files` output variable.
# Paths will be escaped and space-delimited.
# Output is usable as command-line argument list in Linux shell
list-files: shell
filters: |
sheet:
- added|modified: '*/sheet.json'
force-update:
- added|modified: 'build.toml'
process-character-sheets:
name: Process character-sheet HTML/CSS
needs: changes
if: ${{ needs.changes.outputs.sheet == 'true' }}
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
CDN_SHEETS_FOLDER: ${{ vars.CDN_SHEETS_FOLDER }}
DEST_DIR: /tmp
steps:
- uses: actions/checkout@v3
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.SHEET_HTTP_GCP_KEYFILE }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'Use gcloud CLI'
run: 'gcloud info'
- uses: oven-sh/setup-bun@v1
- run: sudo apt-get -y update && sudo apt-get -y install build-essential
# run any `bun` or `bunx` command
- run: bun install
working-directory: contrib/sheet-pixie
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: install
args: fd-find
- run: make clean
- run: bun run contrib/sheet-pixie/index.ts ${{ needs.changes.outputs.sheet-json }}
- run: bash update.sh
- run: bash sync_sheets.sh
force-update:
name: Process HTML/CSS for all character sheets (force-update)
needs: changes
if: ${{ needs.changes.outputs.sheet != 'true' && needs.changes.outputs.force-update == 'true'}}
runs-on: ubuntu-latest
env:
NPM_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
CDN_SHEETS_FOLDER: ${{ vars.CDN_SHEETS_FOLDER }}
DEST_DIR: /tmp
steps:
- uses: actions/checkout@v3
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.SHEET_HTTP_GCP_KEYFILE }}'
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: 'Use gcloud CLI'
run: 'gcloud info'
- uses: oven-sh/setup-bun@v1
- run: sudo apt-get -y update && sudo apt-get -y install build-essential
# run any `bun` or `bunx` command
- run: bun install
working-directory: contrib/sheet-pixie
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: install
args: fd-find
- run: make clean
- run: make all
- run: bash force-update.sh "$DEST_DIR"