-
Notifications
You must be signed in to change notification settings - Fork 6
76 lines (63 loc) · 1.76 KB
/
build-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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Emscripten Build and Deploy
on:
push:
branches:
- master # 仅当推送到main分支时触发
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
actions: write
env:
#emsdk_ver: 3.1.37
emsdk_cache_dir: "emsdk-cache"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Prepare (Host)
run: |
sudo apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y curl tar file \
build-essential pkg-config cmake ninja-build p7zip-full
- name: Cache (Emscripten)
id: cache-emsdk-system-libs
uses: actions/cache@v4
with:
path: ${{ env.emsdk_cache_dir }}
#key: emsdk-${{ env.emsdk_ver }}-${{ runner.os }}
key: emsdk-${{ runner.os }}
- name: Prepare (Emscripten)
uses: mymindstorm/setup-emsdk@v13
with:
#version: ${{ env.emsdk_ver }}
actions-cache-folder: ${{ env.emsdk_cache_dir }}
- name: Run build script
run: |
chmod +x ./build.sh
./build.sh
- name: Upload Build Artifacts
uses: actions/upload-artifact@v4
with:
name: build-dist
path: build/dist
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: build-dist
- name: ls
run: |
ls
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: build/dist