forked from skylersaleh/SkyEmu
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 2.23 KB
/
deploy_web.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
name: Build Web & Deploy to GH
on: [push,pull_request]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
- name: Setup emsdk
uses: mymindstorm/setup-emsdk@v10
with:
version: 2.0.21
actions-cache-folder: 'emsdk-cache'
- name: Install and Build 🔧 # This example project is built using npm and outputs the result to the 'build' folder. Replace with the commands required to build your project, or remove this step entirely if your site is pre-built.
run: |
mkdir build
cd build
emcmake cmake .. -DPLATFORM=Web && cmake --build .
mkdir website
mv bin/SkyEmu.html bin/index.html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/bin # The folder the action should deploy.
target-folder: commit/${{ github.sha }}
force: false
clean: false
- name: Post PR Comment
if: github.event_name == 'pull_request'
uses: mshick/add-pr-comment@v1
with:
message: |
Web build for ${{ github.sha }} will be live at https://web.skyemu.app/commit/${{ github.sha }}/index.html
repo-token: ${{ secrets.GITHUB_TOKEN }}
repo-token-user-login: 'github-actions[bot]' # The user.login for temporary GitHub tokens
allow-repeats: true # This is the default
- name: Deploy to main site 🚀
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/bin # The folder the action should deploy.
force: false
clean: false
- name: Deploy to dev site 🚀
if: github.ref == 'refs/heads/dev'
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: build/bin # The folder the action should deploy.
target-folder: branch/dev
force: false
clean: false