Files
Code-Notes/.github/workflows/build.yaml
Oyasumi Gitea 7299ca4af1
All checks were successful
Build and Deploy Quartz / build-and-deploy (push) Has been skipped
git: lfs workaround for checkoutv6
2026-01-01 14:52:36 +08:00

57 lines
1.7 KiB
YAML

name: Build and Deploy Quartz
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
if: github.event_name == 'workflow_dispatch' || contains(github.event.head_commit.message, 'build')
steps:
- name: Checkout code
uses: actions/checkout@v6
with:
fetch-depth: 1
# lfs: true # THIS DOESN'T WORK!!!!!!!!!
# https://github.com/actions/checkout/issues/1830
- name: Set up Git LFS
run: |
git lfs install --local
AUTH=$(git config http.${{ github.server_url }}/.extraheader)
AUTH_FILE=$(git config includeif.gitdir:/workspace/${{ github.repository }}/.git.path)
git config -f $AUTH_FILE --unset http.${{ github.server_url }}/.extraheader
git config -f $AUTH_FILE http.${{ github.server_url }}/${{ github.repository }}.git/info/lfs/objects/batch.extraheader "$AUTH"
git lfs pull
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
- name: Cache node_modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-modules-
- name: Install dependencies
run: npm install
- name: Build Quartz site
run: npx quartz build --bundleInfo
- name: Deploy to FTP
uses: SamKirkland/FTP-Deploy-Action@v4.3.0
with:
server: ${{ vars.FTP_SERVER }}
username: ${{ vars.FTP_USER }}
password: ${{ vars.FTP_PASSWORD }}
local-dir: public/
server-dir: /codenotes/