Skip to content

webapp react test

webapp react test #36

Workflow file for this run

name: ci
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
workflow_dispatch:
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: Build demo
run: |
./build-demo.sh
# deploy build/demo to gh-pages
- uses: peaceiris/actions-gh-pages@v3
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
# release:
# needs: build
# name: Create Release
# runs-on: ubuntu-latest
# if: startsWith(github.ref, 'refs/tags/')
# steps:
# - uses: actions/checkout@v3
# - uses: actions/download-artifact@v3
# - uses: softprops/action-gh-release@v1
# with:
# files: dist/*.*
# - name: Setup npmrc
# run: |
# echo "@jprendes:registry=https://npm.pkg.github.com/" >> .npmrc
# echo "//npm.pkg.github.com/:_authToken=${{secrets.GITHUB_TOKEN}}" >> .npmrc
# - name: Publish
# run: npm publish