From d68d16190e04e626555feed848c579f23420ce59 Mon Sep 17 00:00:00 2001 From: Joshua Permito Date: Mon, 11 Dec 2023 16:02:41 +0800 Subject: [PATCH] ci: separate build and deploy jobs for documentation --- .github/workflows/docs-cf-pages-publish.yml | 34 ++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/docs-cf-pages-publish.yml b/.github/workflows/docs-cf-pages-publish.yml index 8a49392..10b412d 100644 --- a/.github/workflows/docs-cf-pages-publish.yml +++ b/.github/workflows/docs-cf-pages-publish.yml @@ -18,14 +18,11 @@ env: WRS_DOCKER_VERSION: 232.10275 jobs: - publish: + build: runs-on: ubuntu-latest environment: - name: 'Documentation' + name: 'Build Documentation' url: ${{ steps.deploy-to-cloudflare-pages.outputs.url }} - permissions: - contents: read - deployments: write name: Publish to Cloudflare Pages steps: @@ -63,7 +60,30 @@ jobs: - name: Unzip Writerside artifact uses: montudor/action-zip@v1 with: - args: unzip -qq artifacts/${{ env.WRS_ARTIFACT }} -d ./built_docs/code + args: unzip -qq artifacts/${{ env.WRS_ARTIFACT }} -d ./built_docs/handbook + + - name: Archive documentation + uses: actions/upload-artifact@v3 + with: + name: docs + path: built_docs + retention-days: 7 + + deploy: + runs-on: ubuntu-latest + environment: + name: 'Publish Documentation' + url: ${{ steps.deploy-to-cloudflare-pages.outputs.url }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Download documentation + uses: actions/download-artifact@v3 + with: + name: docs + path: built_docs - name: Publish to Cloudflare Pages uses: cloudflare/pages-action@1 @@ -73,4 +93,4 @@ jobs: accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }} directory: built_docs - gitHubToken: ${{ secrets.GITHUB_TOKEN }} + gitHubToken: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file