Skip to content

SkyEmu v4

SkyEmu v4 #1965

Workflow file for this run

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
continue-on-error: true
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