j40-cejst-2/.github/workflows/build_deploy.yml
Nat Hillard a432a0d8c9
Adding Linting and Formatting (#77)
Addresses #11 item "Linting/formatting (eg eslnt, prettier)":
* Adding eslint, prettier, and config targeting Google, typescript, and both nodejs and client builds
* Addressing linter-found issues
* Adding lint and lint:fix commands
* Adding documentation
* Renaming workflow and adding lint check
* Adding documentation about VSCode linting/formatting, ran formatting on a few files, set up exclude list for gatsby develop, setup build to fail on error
2021-05-25 16:21:21 -04:00

63 lines
2 KiB
YAML

# This workflow will do a clean install of node dependencies, 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
# This workflow will do a clean install of node dependencies, 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: GH Pages deploy
on:
push:
branches: [main]
paths:
- 'client/**/*'
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: client
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
- name: Build
run: npm run build --if-present
- name: Get directory contents
run: ls -la public
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: J40Static
# Upload-artifact does not support the default working directory
# See more: https://github.com/actions/upload-artifact/issues/87
path: ./client/public
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout source
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: J40Static
path: ./public
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.0
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: public # The folder the action should deploy.