2019-09-15 01:22:02 +02:00
|
|
|
name: Build and deploy website
|
2020-03-19 23:54:58 +01:00
|
|
|
|
2019-09-15 01:22:02 +02:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2020-03-19 23:54:58 +01:00
|
|
|
|
2019-09-15 01:22:02 +02:00
|
|
|
jobs:
|
2020-03-19 23:54:58 +01:00
|
|
|
build-deploy:
|
2019-09-15 01:22:02 +02:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2022-01-11 15:10:42 +01:00
|
|
|
- name: Cancel previous runs
|
|
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
|
|
with:
|
|
|
|
access_token: ${{ github.token }}
|
|
|
|
all_but_latest: true
|
|
|
|
|
2019-09-15 01:22:02 +02:00
|
|
|
- name: Checkout repository
|
2020-03-19 23:54:58 +01:00
|
|
|
uses: actions/checkout@v2
|
2021-07-31 16:47:51 +02:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2019-09-15 01:22:02 +02:00
|
|
|
|
2021-07-31 16:56:59 +02:00
|
|
|
- name: Setup Node.js
|
2021-03-13 21:06:10 +01:00
|
|
|
uses: actions/setup-node@v2
|
2019-09-15 01:22:02 +02:00
|
|
|
with:
|
2021-12-08 03:09:30 +01:00
|
|
|
node-version: 16
|
2021-07-31 16:56:59 +02:00
|
|
|
|
2021-03-13 21:06:10 +01:00
|
|
|
- name: Check cache
|
|
|
|
uses: actions/cache@v2
|
|
|
|
id: npm-cache
|
|
|
|
with:
|
|
|
|
path: '**/node_modules'
|
|
|
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
2021-07-31 16:56:59 +02:00
|
|
|
|
2021-03-13 21:06:10 +01:00
|
|
|
- name: Install dependencies
|
|
|
|
if: steps.npm-cache.outputs.cache-hit != 'true'
|
|
|
|
run: npm install
|
2019-09-15 01:22:02 +02:00
|
|
|
|
|
|
|
- name: Build website
|
2021-03-13 21:06:10 +01:00
|
|
|
run: npm run build
|
2019-09-15 01:22:02 +02:00
|
|
|
|
2020-03-19 23:54:58 +01:00
|
|
|
- name: Add .nojekyll
|
2019-09-15 01:33:38 +02:00
|
|
|
run: touch ./public/.nojekyll
|
|
|
|
|
2019-09-15 01:22:02 +02:00
|
|
|
- name: Deploy website
|
2020-03-19 23:54:58 +01:00
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
|
|
|
|
publish_branch: gh-pages
|
|
|
|
publish_dir: ./public
|
2020-05-21 04:47:01 +02:00
|
|
|
user_name: "github-actions[bot]"
|
|
|
|
user_email: "github-actions[bot]@users.noreply.github.com"
|
2020-03-19 23:54:58 +01:00
|
|
|
commit_message: ${{ github.event.head_commit.message }}
|