Update dependencies #585
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
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Test and Deploy React app | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main", "beta" ] | |
release: | |
type: [published] | |
workflow_dispatch: | |
inputs: | |
Deploy: | |
description: Deploy the result to Github Pages | |
required: false | |
type: boolean | |
jobs: | |
build: | |
name: Build and Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8.6.10 | |
- name: Use Node.js 16.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
cache: 'pnpm' | |
- name: Install and Build | |
run: | | |
pnpm install --frozen-lockfile | |
pnpm build --if-present | |
- name: Test | |
run: pnpm test | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: production-files | |
path: ./build | |
deploy: | |
name: Deploy | |
if: (github.event_name == 'workflow_dispatch' && inputs.Deploy) || github.event_name == 'release' | |
runs-on: ubuntu-latest | |
needs: build | |
concurrency: | |
group: deploy | |
cancel-in-progress: true | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
name: production-files | |
path: ./build | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
publish_dir: ./build | |
github_token: ${{ secrets.GITHUB_TOKEN }} |