Quartz sync: Jan 10, 2026, 1:41 PM
This commit is contained in:
parent
27a4154004
commit
acf95c051d
7 changed files with 2801 additions and 2746 deletions
43
.github/workflows/build-preview.yaml
vendored
43
.github/workflows/build-preview.yaml
vendored
|
|
@ -1,43 +0,0 @@
|
||||||
name: Build Preview Deployment
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types: [opened, synchronize]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-preview:
|
|
||||||
if: ${{ github.repository == 'jackyzha0/quartz' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Build Preview
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
|
||||||
uses: actions/cache@v5
|
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- run: npm ci
|
|
||||||
|
|
||||||
- name: Check types and style
|
|
||||||
run: npm run check
|
|
||||||
|
|
||||||
- name: Build Quartz
|
|
||||||
run: npx quartz build -d docs -v
|
|
||||||
|
|
||||||
- name: Upload build artifact
|
|
||||||
uses: actions/upload-artifact@v6
|
|
||||||
with:
|
|
||||||
name: preview-build
|
|
||||||
path: public
|
|
||||||
72
.github/workflows/ci.yaml
vendored
72
.github/workflows/ci.yaml
vendored
|
|
@ -1,72 +0,0 @@
|
||||||
name: Build and Test
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- v4
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- v4
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-test:
|
|
||||||
if: ${{ github.repository == 'jackyzha0/quartz' }}
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
os: [windows-latest, macos-latest, ubuntu-latest]
|
|
||||||
runs-on: ${{ matrix.os }}
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
|
|
||||||
- name: Cache dependencies
|
|
||||||
uses: actions/cache@v5
|
|
||||||
with:
|
|
||||||
path: ~/.npm
|
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-node-
|
|
||||||
|
|
||||||
- run: npm ci
|
|
||||||
|
|
||||||
- name: Check types and style
|
|
||||||
run: npm run check
|
|
||||||
|
|
||||||
- name: Test
|
|
||||||
run: npm test
|
|
||||||
|
|
||||||
- name: Ensure Quartz builds, check bundle info
|
|
||||||
run: npx quartz build --bundleInfo -d docs
|
|
||||||
|
|
||||||
publish-tag:
|
|
||||||
if: ${{ github.repository == 'jackyzha0/quartz' && github.ref == 'refs/heads/v4' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Setup Node
|
|
||||||
uses: actions/setup-node@v6
|
|
||||||
with:
|
|
||||||
node-version: 22
|
|
||||||
- name: Get package version
|
|
||||||
run: node -p -e '`PACKAGE_VERSION=${require("./package.json").version}`' >> $GITHUB_ENV
|
|
||||||
- name: Create release tag
|
|
||||||
uses: pkgdeps/git-tag-action@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
github_repo: ${{ github.repository }}
|
|
||||||
version: ${{ env.PACKAGE_VERSION }}
|
|
||||||
git_commit_sha: ${{ github.sha }}
|
|
||||||
git_tag_prefix: "v"
|
|
||||||
37
.github/workflows/deploy-preview.yaml
vendored
37
.github/workflows/deploy-preview.yaml
vendored
|
|
@ -1,37 +0,0 @@
|
||||||
name: Upload Preview Deployment
|
|
||||||
on:
|
|
||||||
workflow_run:
|
|
||||||
workflows: ["Build Preview Deployment"]
|
|
||||||
types:
|
|
||||||
- completed
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
actions: read
|
|
||||||
deployments: write
|
|
||||||
contents: read
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
deploy-preview:
|
|
||||||
if: ${{ github.repository == 'jackyzha0/quartz' && github.event.workflow_run.conclusion == 'success' }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
name: Deploy Preview to Cloudflare Pages
|
|
||||||
steps:
|
|
||||||
- name: Download build artifact
|
|
||||||
uses: actions/download-artifact@v7
|
|
||||||
id: preview-build-artifact
|
|
||||||
with:
|
|
||||||
name: preview-build
|
|
||||||
path: build
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run-id: ${{ github.event.workflow_run.id }}
|
|
||||||
|
|
||||||
- name: Deploy to Cloudflare Pages
|
|
||||||
uses: AdrianGonz97/refined-cf-pages-action@v1
|
|
||||||
with:
|
|
||||||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
||||||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
||||||
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
projectName: quartz
|
|
||||||
deploymentName: Branch Preview
|
|
||||||
directory: ${{ steps.preview-build-artifact.outputs.download-path }}
|
|
||||||
45
.github/workflows/deploy.yaml
vendored
Normal file
45
.github/workflows/deploy.yaml
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
name: Deploy Quartz site to GitHub Pages
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- v4
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: "pages"
|
||||||
|
cancel-in-progress: false
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0 # Fetch all history for git info
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: npm ci
|
||||||
|
- name: Build Quartz
|
||||||
|
run: npx quartz build
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
with:
|
||||||
|
path: public
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Deploy to GitHub Pages
|
||||||
|
id: deployment
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
88
.github/workflows/docker-build-push.yaml
vendored
88
.github/workflows/docker-build-push.yaml
vendored
|
|
@ -1,88 +0,0 @@
|
||||||
name: Docker build & push image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [v4]
|
|
||||||
tags: ["v*"]
|
|
||||||
pull_request:
|
|
||||||
branches: [v4]
|
|
||||||
paths:
|
|
||||||
- .github/workflows/docker-build-push.yaml
|
|
||||||
- quartz/**
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
if: ${{ github.repository == 'jackyzha0/quartz' }} # Comment this out if you want to publish your own images on a fork!
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Set lowercase repository owner environment variable
|
|
||||||
run: |
|
|
||||||
echo "OWNER_LOWERCASE=${OWNER,,}" >> ${GITHUB_ENV}
|
|
||||||
env:
|
|
||||||
OWNER: "${{ github.repository_owner }}"
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
with:
|
|
||||||
fetch-depth: 1
|
|
||||||
- name: Inject slug/short variables
|
|
||||||
uses: rlespinasse/github-slug-action@v5.4.0
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
install: true
|
|
||||||
driver-opts: |
|
|
||||||
image=moby/buildkit:master
|
|
||||||
network=host
|
|
||||||
- name: Install cosign
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
uses: sigstore/cosign-installer@v4.0.0
|
|
||||||
- name: Login to GitHub Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
with:
|
|
||||||
registry: ghcr.io
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: Extract metadata tags and labels on PRs
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
id: meta-pr
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz
|
|
||||||
tags: |
|
|
||||||
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}
|
|
||||||
labels: |
|
|
||||||
org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz"
|
|
||||||
- name: Extract metadata tags and labels for main, release or tag
|
|
||||||
if: github.event_name != 'pull_request'
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
flavor: |
|
|
||||||
latest=auto
|
|
||||||
images: ghcr.io/${{ env.OWNER_LOWERCASE }}/quartz
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}
|
|
||||||
type=semver,pattern={{major}}.{{minor}}.{{patch}}
|
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }}
|
|
||||||
type=raw,value=sha-${{ env.GITHUB_SHA_SHORT }}
|
|
||||||
labels: |
|
|
||||||
maintainer=${{ github.repository_owner }}
|
|
||||||
org.opencontainers.image.source="https://github.com/${{ github.repository_owner }}/quartz"
|
|
||||||
|
|
||||||
- name: Build and push Docker image
|
|
||||||
id: build-and-push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
push: ${{ github.event_name != 'pull_request' }}
|
|
||||||
build-args: |
|
|
||||||
GIT_SHA=${{ env.GITHUB_SHA }}
|
|
||||||
DOCKER_LABEL=sha-${{ env.GITHUB_SHA_SHORT }}
|
|
||||||
tags: ${{ steps.meta.outputs.tags || steps.meta-pr.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels || steps.meta-pr.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha
|
|
||||||
35
.github/workflows/publish.yaml
vendored
35
.github/workflows/publish.yaml
vendored
|
|
@ -1,35 +0,0 @@
|
||||||
name: Build Quartz Site
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: ["v4"]
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
pages: write
|
|
||||||
id-token: write
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Setup Pages
|
|
||||||
uses: actions/configure-pages@v5
|
|
||||||
- name: Build
|
|
||||||
uses: robinsving/quartz-build-action@main
|
|
||||||
with:
|
|
||||||
source: content
|
|
||||||
page_title: "The Crimson World"
|
|
||||||
quartz_config: quartz.config.ts
|
|
||||||
quartz_layout: quartz.layout.ts
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-pages-artifact@v3
|
|
||||||
deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build
|
|
||||||
steps:
|
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
id: deployment
|
|
||||||
uses: actions/deploy-pages@v4
|
|
||||||
environment:
|
|
||||||
name: github-pages
|
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
|
||||||
5209
package-lock.json
generated
5209
package-lock.json
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue