66 lines
1.6 KiB
YAML
66 lines
1.6 KiB
YAML
name: Build Quartz site
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: "Fetching Quartz"
|
|
uses: actions/checkout@v3
|
|
with:
|
|
repository: 'jackyzha0/quartz'
|
|
path: 'quartz'
|
|
github-server-url: 'https://github.com'
|
|
token: ${{ secrets.GH_PAT }}
|
|
|
|
- name: Cache node modules
|
|
id: cache-npm
|
|
uses: actions/cache@v3
|
|
env:
|
|
cache-name: cache-node-modules
|
|
with:
|
|
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
path: ~/.npm
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
${{ runner.os }}-build-
|
|
${{ runner.os }}-
|
|
|
|
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }}
|
|
name: List the state of node modules
|
|
continue-on-error: true
|
|
run: npm list
|
|
|
|
- name: "Checkout"
|
|
uses: actions/checkout@v3
|
|
with:
|
|
path: 'quartz/content'
|
|
fetch-depth: 0 # Fetch all history for git info
|
|
|
|
- name: "Install Node"
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version: 18.14
|
|
|
|
- name: Install Dependencies
|
|
run: npm ci
|
|
working-directory: ./quartz
|
|
|
|
- name: Build Quartz
|
|
run: npx quartz build
|
|
working-directory: ./quartz
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v2
|
|
with:
|
|
path: ./quartz/public |