Skip to content

Instantly share code, notes, and snippets.

@karbassi
Created April 26, 2022 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karbassi/0c8b8f13122d6153e81823fa2bf21444 to your computer and use it in GitHub Desktop.
Save karbassi/0c8b8f13122d6153e81823fa2bf21444 to your computer and use it in GitHub Desktop.
name: Publish Website to GitHub Pages
on:
push:
branches:
- master
- main
jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install dependencies
run: npm ci
- name: Test
run: npm run test --if-present
- name: Build
run: npm run build --if-present
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment