diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index c2fd108..4222c40 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -49,18 +49,11 @@ jobs: - name: Publish Docs to Cloudflare Pages if: ${{ steps.release.outputs.releases_created }} - uses: cloudflare/wrangler-action@v3 + uses: cloudflare/pages-action@v1 with: - gitHubToken: ${{ secrets.GITHUB_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./docs/build --project-name=sprinter-docs - - - name: Publish POC to Cloudflare Pages - if: ${{ steps.release.outputs.releases_created }} - uses: cloudflare/wrangler-action@v3 - with: + projectName: gopher-docs-preview + directory: ./docs/build gitHubToken: ${{ secrets.GITHUB_TOKEN }} - apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} - accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./web/.svelte-kit/cloudflare --project-name=sprinter-poc + branch: ${{ github.head_ref || github.ref_name }} \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce6da1e..399e3b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,49 +29,21 @@ jobs: run: 'yarn run test:unit' - name: "Integrations Tests" run: 'yarn run test:integrations' - - name: Set branch name for Cloudflare Pages - id: cf-branch - run: | - if [[ "${{ github.ref_name }}" == "master" ]]; then - echo "CF_BRANCH_NAME=preview" >> $GITHUB_ENV - else - echo "CF_BRANCH_NAME=${{ github.head_ref || github.ref_name }}" >> $GITHUB_ENV - fi - - name: Publish Docs to Cloudflare Pages - id: docs-publish - uses: cloudflare/wrangler-action@v3 + - name: Publish POC to Cloudflare Pages + uses: cloudflare/pages-action@v1 with: - gitHubToken: ${{ secrets.GITHUB_TOKEN }} apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./docs/build --project-name=sprinter-docs --branch=${{ env.CF_BRANCH_NAME }} - - name: Publish POC to Cloudflare Pages - id: poc-publish - uses: cloudflare/wrangler-action@v3 - with: + projectName: gopher-poc + directory: ./web/.svelte-kit/cloudflare gitHubToken: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref || github.ref_name }} + - name: Publish Preview Docs to Cloudflare Pages + uses: cloudflare/pages-action@v1 + with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: 2238a825c5aca59233eab1f221f7aefb - command: pages deploy ./web/.svelte-kit/cloudflare --project-name=sprinter-poc --branch=${{ env.CF_BRANCH_NAME }} - - name: Generate Deployment Summary - run: | - echo "# 🚀 Deployment Summary" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "| **Project** | **Preview URL** |" >> $GITHUB_STEP_SUMMARY - echo "| ----------------------- | ---------------- |" >> $GITHUB_STEP_SUMMARY - echo "| **Docs** | [View Docs -> ${{ steps.docs-publish.outputs.deployment-url }}](${{ steps.docs-publish.outputs.deployment-url }}) |" >> $GITHUB_STEP_SUMMARY - echo "| **POC** | [View POC -> ${{ steps.poc-publish.outputs.deployment-url }}](${{ steps.poc-publish.outputs.deployment-url }}) |" >> $GITHUB_STEP_SUMMARY - - name: Notify About Deployment - if: ${{ github.actor != 'dependabot[bot]' }} - uses: actions/github-script@v7 - with: - script: | - const docsUrl = `**Docs:** [View Deployment -> ${{ steps.docs-publish.outputs.deployment-url }}](${{ steps.docs-publish.outputs.deployment-url }})`; - const pocUrl = `**POC:** [View Deployment -> ${{ steps.poc-publish.outputs.deployment-url }}](${{ steps.poc-publish.outputs.deployment-url }})`; - const message = `🚀 **Deployment Completed**\n\n${docsUrl}\n${pocUrl}`; - await github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: message, - }); + projectName: gopher-docs-preview + directory: ./docs/build + gitHubToken: ${{ secrets.GITHUB_TOKEN }} + branch: ${{ github.head_ref || github.ref_name }} \ No newline at end of file