Skip to content

Workflow file for this run

on: [push, workflow_dispatch]
jobs:
publish-nextjs-project-using-wrangler-action:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./nextjs-project
name: Publish nextjs-project to Cloudflare using wrangler action
steps:
- name: Checkout
uses: actions/checkout@v4
# Run a build step here if your project requires
- name: Build command
run: npx @cloudflare/next-on-pages@1
- name: Deploy
id: deploy
uses: cloudflare/wrangler-action@maximo/add-github-deployments-parity-for-pages-deployments-in-wrangler-action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: './nextjs-project'
command: pages deploy .vercel/output/static --project-name=demo-actions
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Outputs
run: |
echo "ID: ${{ steps.deploy.outputs.pages-deployment-id }}"
echo "URL: ${{ steps.deploy.outputs.deployment-url }}"
echo "Environment: ${{ steps.deploy.outputs.pages-environment }}"
echo "Deprecated Alias: ${{ steps.deploy.outputs.pages-deployment-alias-url }}"
echo "Alias: ${{ steps.deploy.outputs.deployment-alias-url }}"
- name: Deploy 2
id: deploy2
uses: cloudflare/wrangler-action@maximo/add-github-deployments-parity-for-pages-deployments-in-wrangler-action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: './nextjs-project'
command: pages deploy .vercel/output/static --project-name=demo-actions
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Outputs
run: |
echo "ID: ${{ steps.deploy2.outputs.pages-deployment-id }}"
echo "URL: ${{ steps.deploy2.outputs.deployment-url }}"
echo "Environment: ${{ steps.deploy2.outputs.pages-environment }}"
echo "Deprecated Alias: ${{ steps.deploy2.outputs.pages-deployment-alias-url }}"
echo "Alias: ${{ steps.deploy2.outputs.deployment-alias-url }}"
publish-simple-html-using-wrangler-action:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
defaults:
run:
working-directory: ./simple-html
name: Publish simple html project to Cloudflare using wrangler action
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
id: deploy
uses: cloudflare/wrangler-action@maximo/add-github-deployments-parity-for-pages-deployments-in-wrangler-action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: './simple-html'
command: pages deploy site --project-name=demo-actions
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Outputs
run: |
echo "ID: ${{ steps.deploy.outputs.pages-deployment-id }}"
echo "URL: ${{ steps.deploy.outputs.deployment-url }}"
echo "Environment: ${{ steps.deploy.outputs.pages-environment }}"
echo "Deprecated Alias: ${{ steps.deploy.outputs.pages-deployment-alias-url }}"
echo "Alias: ${{ steps.deploy.outputs.deployment-alias-url }}"
publish-hello-world-workers-project-npm-using-wrangler-action:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./hello-world-workers-project-npm
name: Publish hello-world-workers-project-npm to Cloudflare using wrangler action
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: cloudflare/wrangler-action@maximo/add-github-deployments-parity-for-pages-deployments-in-wrangler-action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: './hello-world-workers-project-npm'
command: deploy src/index.ts
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
publish-hello-world-workers-project-pnpm-using-wrangler-action:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./hello-world-workers-project-pnpm
name: Publish hello-world-workers-project-pnpm to Cloudflare using wrangler action
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Deploy
uses: cloudflare/wrangler-action@maximo/add-github-deployments-parity-for-pages-deployments-in-wrangler-action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: './hello-world-workers-project-pnpm'
command: deploy src/index.ts
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
publish-hello-world-workers-project-yarn-using-wrangler-action:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./hello-world-workers-project-pnpm
name: Publish hello-world-workers-project-yarn to Cloudflare using wrangler action
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Deploy
uses: cloudflare/wrangler-action@maximo/add-github-deployments-parity-for-pages-deployments-in-wrangler-action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: './hello-world-workers-project-yarn'
command: deploy src/index.ts
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
publish-hello-world-workers-project-bun-using-wrangler-action:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./hello-world-workers-project-bun
name: Publish hello-world-workers-project-bun to Cloudflare using wrangler action
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest
- name: Deploy
id: deploy
uses: cloudflare/wrangler-action@maximo/add-github-deployments-parity-for-pages-deployments-in-wrangler-action
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: './hello-world-workers-project-bun'
command: deploy src/index.ts
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Outputs
run: |
echo "URL: ${{ steps.deploy.outputs.deployment-url }}"
echo "Deprecated Alias: ${{ steps.deploy.outputs.pages-deployment-alias-url }}"
echo "Alias: ${{ steps.deploy.outputs.deployment-alias-url }}"