Maybe this one? 🙏 #180
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
on: push | |
name: "Build, Test & Deploy 🚀" | |
jobs: | |
build: | |
if: "!contains(github.event.head_commit.message, 'no-ci')" | |
name: Build Lib | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16.14.2 | |
- name: Cache node_modules | |
id: cache-modules | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-build-${{ hashFiles('package.json') }} | |
- name: Install Dependencies | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: yarn install --pure-lockfile | |
- name: Check library builds | |
run: yarn build | |
- name: Check tests build | |
run: yarn tsc-test | |
- name: Check tests pass | |
run: yarn test | |
- name: Upload lib build artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-lib | |
path: dist | |
deploy: | |
if: "!contains(github.event.head_commit.message, 'no-deploy-lib')" | |
needs: build | |
name: Deploy Library | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16.14.2 | |
- uses: actions/cache@v1 | |
id: cache-modules | |
with: | |
path: node_modules | |
key: ${{ runner.OS }}-deploy-${{ hashFiles('package.json') }} | |
- name: Download build-lib | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-lib | |
path: dist | |
- name: Deploy to npm! 🚀 (if master branch) | |
if: github.ref == 'refs/heads/master' | |
uses: benwinding/merge-release@fix-master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
demo: | |
needs: build | |
name: Deploy Demo | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16.14.2 | |
- uses: actions/cache@v1 | |
id: cache-modules | |
with: | |
path: src-demo/node_modules | |
key: ${{ runner.OS }}-demo-${{ hashFiles('src-demo/package.json') }} | |
- name: Install Dependencies | |
if: steps.cache-modules.outputs.cache-hit != 'true' | |
run: yarn install | |
working-directory: ./src-demo | |
- run: REACT_APP_FIREBASE_CONFIG="${{ secrets.FIREBASE_JSON }}" yarn build-ci | |
working-directory: ./src-demo | |
- name: Deploy to GH Pages 🚀 | |
if: github.ref == 'refs/heads/master' | |
uses: JamesIves/github-pages-deploy-action@releases/v3 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BRANCH: gh-pages # The branch the action should deploy to. | |
FOLDER: src-demo/build # The folder the action should deploy. |