workflow #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Quartz build&deploy | |
on: | |
push: | |
branches: [notes,main] | |
pull_request: | |
branches: [notes,main] | |
types: auto_merge_enabled | |
env: | |
TZ: Asia/Shanghai | |
GITHUB_TOKEN: ${{ secrets.PUBLISH_TOKEN }} | |
jobs: | |
Build-deploy: | |
name: Check notes and build&deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout codes | |
uses: actions/checkout@v2 | |
with: | |
ref: 'main' | |
- name: Setup node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.19.0' | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
- name: Install dependencies | |
run: | | |
npm install | |
git clone -b notes https://github.com/blleng/obsidian-notes/ content | |
- name: Build site | |
run: | | |
npx quartz build | |
echo "freezing.cool" > ./public/CNAME | |
- name: Deploy to gh-page | |
uses: crazy-max/ghaction-github-pages@v3.1.0 | |
with: | |
target_branch: gh-page | |
build_dir: ./public | |
jekyll: false |