Jacky Zhao
2025-04-28 00e860d8e687d2cd77f425b7ba77b3b591458127
ci: fix fork preview
1 files added
1 files renamed
48 ■■■■ changed files
.github/workflows/build-preview.yaml 11 ●●●●● patch | view | raw | blame | history
.github/workflows/deploy-preview.yaml 37 ●●●●● patch | view | raw | blame | history
.github/workflows/build-preview.yaml
File was renamed from .github/workflows/preview.yaml
@@ -36,11 +36,8 @@
      - name: Build Quartz
        run: npx quartz build -d docs -v
      - name: Publish to Cloudflare Pages
        uses: AdrianGonz97/refined-cf-pages-action@v1
      - name: Upload build artifact
        uses: actions/upload-artifact@v4
        with:
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
          githubToken: ${{ secrets.GITHUB_TOKEN }}
          projectName: quartz
          directory: public
          name: preview-build
          path: public
.github/workflows/deploy-preview.yaml
New file
@@ -0,0 +1,37 @@
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@v4
        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: YOUR_PROJECT_NAME
          deploymentName: Preview
          directory: ${{ steps.preview-build-artifact.outputs.download-path }}