diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index b2b632d..55c4a6a 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -26,7 +26,30 @@ jobs: - uses: actions/upload-pages-artifact@v3 with: path: 'public' - deploy: + clouflare: + needs: [build] + timeout-minutes: 15 + runs-on: ubuntu-24.04 + permissions: + contents: read + deployments: write + steps: + - uses: actions/checkout@v4 # For enabling repo in gh command + - name: Download build assets + env: + GH_TOKEN: ${{ github.token }} + # upload-pages-artifact actually uploading artifacts with special structure. So we can download them + # See https://github.com/actions/upload-pages-artifact/blob/2d163be3ddce01512f3eea7ac5b7023b5d643ce1/.github/workflows/test-hosted-runners.yml#L37-L45 + run: | + gh run download + - name: Deploy + uses: cloudflare/wrangler-action@6d58852c35a27e6034745c5d0bc373d739014f7f # v3.13.0 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy public --project-name=example + gitHubToken: ${{ github.token }} + github: needs: [build] if: ${{ github.event_name != 'pull_request' }} timeout-minutes: 15