Add deploy job #202
Workflow file for this run
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: Build | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
env: | |
JE2BE_DOCKER_CACHE_PATH: je2be_build_wasm.docker | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache docker image | |
uses: actions/cache@v4 | |
id: cache-docker-image | |
with: | |
path: ${{ env.JE2BE_DOCKER_CACHE_PATH }} | |
key: ${{ hashFiles('Dockerfile') }} | |
- name: Build docker image | |
if: steps.cache-docker-image.outputs.cache-hit != 'true' | |
run: | | |
make docker_image | |
docker save je2be_build_wasm:latest -o ${JE2BE_DOCKER_CACHE_PATH} | |
build: | |
runs-on: ubuntu-latest | |
if: github.ref_type != 'tag' | |
needs: [docker] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: yarn | |
- name: Cache docker image | |
uses: actions/cache@v4 | |
id: cache-docker-image | |
with: | |
path: ${{ env.JE2BE_DOCKER_CACHE_PATH }} | |
key: ${{ hashFiles('Dockerfile') }} | |
- name: Restore docker image | |
run: docker load -i ${JE2BE_DOCKER_CACHE_PATH} | |
- name: Build | |
env: | |
JE2BE_VERSION: ${{ github.ref_name }} | |
run: | | |
yarn install | |
make all | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.ref_type == 'tag' | |
needs: [docker] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: .node-version | |
cache: yarn | |
- name: Cache docker image | |
uses: actions/cache@v4 | |
id: cache-docker-image | |
with: | |
path: ${{ env.JE2BE_DOCKER_CACHE_PATH }} | |
key: ${{ hashFiles('Dockerfile') }} | |
- name: Restore docker image | |
run: docker load -i ${JE2BE_DOCKER_CACHE_PATH} | |
- uses: actions/configure-pages@v5 | |
- name: Build | |
env: | |
JE2BE_VERSION: ${{ github.ref_name }} | |
run: | | |
yarn install | |
make all | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: './public' | |
- uses: actions/deploy-pages@v4 | |
- name: Setup bugsnag | |
env: | |
JE2BE_VERSION: ${{ github.ref_name }} | |
BUGSNAG_API_KEY: ${{ secrets.BUGSNAG_API_KEY }} | |
run: | | |
yarn reportbuild | |
yarn upsourcemaps |