Cf Pages for Github Actions
After you modify the action.ts file, you need to re-run pnpm run build to generate new products.
Github Action Secrets:
ACTIONS_PATCLOUDFLARE_API_TOKENCLOUDFLARE_ACCOUNT_IDCLOUDFLARE_PROJECT_NAMEname: Deploy
on:
push:
tags:
- 'v*'
jobs:
deploy-prod:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Send POST request
run: |
# Send POST request to trigger cloudflare pages build
- name: Checkout Private Action Repository
uses: actions/checkout@v2
with:
repository: pandapro-project/web-tools # repository url; [owner/repo] like pandapro-project/web-tools
ref: main
token: ${{ secrets.ACTIONS_PAT }}
- name: Cf pages build progress
id: 'cf-pages-build-progress'
uses: ./packages/webtools-cf-pages/ # path to the action.yaml
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME}}
- name: Output build result
run: |
echo "Development id: ${{ steps.cf-pages-build-progress.outputs.deploymentId }}"
echo "Environment: ${{ steps.cf-pages-build-progress.outputs.environment }}"
echo "Website preview url: ${{ steps.cf-pages-build-progress.outputs.previewUrl }}"
echo "Build status: ${{ steps.cf-pages-build-progress.outputs.status}}"
deploymentId: Deployment idenvironment: Environment, e.g. production or previewpreviewUrl: Website preview urlstatus: Build status, if the build is successful, it will return success.Cf Pages Build Progress

Output Build Result
