emception worker typescript webpack #46
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: ci | |
# runs on every push to any branch | |
on: | |
push: | |
branches: | |
- '*' | |
jobs: | |
build: | |
name: Build | |
runs-on: self-hosted | |
steps: | |
- uses: actions/checkout@v3 | |
# - name: Log in to registry | |
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
# cache 'upstream' and 'demo/node_modules' folders | |
# - uses: actions/cache@v2 | |
# with: | |
# path: | | |
# upstream | |
# demo/node_modules | |
# build/emsdk_cache | |
# key: ${{ runner.os }}-${{ hashFiles('build/emsdk_cache/sanity.txt') }}-${{ hashFiles('demo/package-lock.json') }} | |
# restore-keys: ${{ runner.os }}-upstream- | |
- name: Build | |
run: | | |
./build-with-docker.sh | |
# install node 14 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: Check branch and file | |
env: | |
GITHUB_REF: ${{ github.ref }} | |
run: | | |
if [ "$GITHUB_REF" = "refs/heads/master" ] && [ -e "build/demo/index.html" ]; then | |
export RUN_PUBLISH=true | |
else | |
export RUN_PUBLISH=false | |
fi | |
# deploy build/demo to gh-pages | |
- name: Publish demo to gh-pages | |
uses: peaceiris/actions-gh-pages@v3 | |
# runs only on master and if the file build/demo/index.html exists | |
if: env.RUN_PUBLISH == 'true' | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./build/demo | |
publish_branch: gh-pages | |
force_orphan: true | |
- name: Zip artifact for deployment | |
run: zip build.zip ./build/* -r | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: dist | |
path: ./build.zip | |
retention-days: 1 |