Add caching for emsdk #25
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: deploy-github-pages | |
permissions: | |
id-token: write | |
pages: write | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
emscripten: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache emsdk | |
id: cache-emsdk-3_1_61 | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-emsdk | |
with: | |
path: emsdk | |
- name: Checkout rom and HD image for web version | |
working-directory: ${{ github.workspace }}/ | |
run: | | |
git clone --depth=1 https://github.com/misterblack1/plexus-p20.git | |
mv plexus-p20/ROMs/U17-MERGED.BIN plexus-p20/ROMs/U15-MERGED.BIN . | |
gunzip < plexus-p20/disk/plexus-sanitized.img.gz > plexus-sanitized.img | |
- name: Get emscripten | |
working-directory: ${{ github.workspace }}/ | |
run: | | |
[ ! -e emsdk ] && git clone --depth=1 https://github.com/emscripten-core/emsdk.git | |
cd emsdk; ./emsdk install 3.1.61; ./emsdk activate 3.1.61 | |
- name: Generate musashi headers | |
working-directory: ${{ github.workspace }}/ | |
run: cd Musashi; make | |
- name: Compile for web | |
working-directory: ${{ github.workspace }}/ | |
run: source ./emsdk/emsdk_env.sh; ls -l; make plexem.mjs | |
- name: Install web deps and collect artifacts | |
working-directory: ${{ github.workspace }}/ | |
run: make webdeploy | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: 'web' | |
deploy: | |
# Only run if we can deploy to https://spritetm.github.io/plexus_20_emu/ | |
if: ${{ github.repository == 'Spritetm/plexus_20_emu' }} | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
needs: emscripten | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |