Skip to content

Merge pull request #117 from KHwong12/dependabot/github_actions/James… #31

Merge pull request #117 from KHwong12/dependabot/github_actions/James…

Merge pull request #117 from KHwong12/dependabot/github_actions/James… #31

# This workflow will do a clean install 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
# Edited from https://github.com/imomaliev/vue-ts/blob/main/.github/workflows/deploy.yml
name: Build and Deploy
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3 # If you're using actions/checkout@v2 you must set persist-credentials to false in most cases for the deployment to work correctly.
with:
persist-credentials: false
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci --legacy-peer-deps --save --save-exact
- run: npm run build
- name: Deploy 🚀
# deploy only for version 16.x
uses: JamesIves/github-pages-deploy-action@v4.4.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages # The branch the action should deploy to.
folder: './dist' # Require `./` to specify folder location (otherwise action will search for `~/dist`?)
clean: true # Automatically remove deleted files from the deploy branch