Fix Jest error #104
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: Code Build and Deployment | |
on: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
# Allow one concurrent deployment | |
concurrency: | |
group: "build" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build and Deploy Code | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
- name: Install Dependencies | |
run: npm ci | |
- name: Build Code | |
run: npm run build --if-present | |
- name: Test Code | |
run: npm test | |
- name: Deploy Code to records Branch | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email 'action@github.com' | |
cp -R dist/* . | |
git add -A | |
git diff-index --quiet HEAD || git commit -am "temp commit dist" | |
git fetch | |
git checkout records | |
git restore --source main *.js *.js.map *.svg package.json package-lock.json docs/*.html docs/*.js | |
git add -A | |
git diff-index --quiet HEAD || git commit -am "Deploy new build" | |
git push origin records |