Skip to content

Deploy

Deploy #380

Workflow file for this run

# https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/
# https://github.com/cloudflare/wrangler-action
name: Deploy
on:
schedule:
- cron: "00 15 * * *"
- cron: "00 16 * * *"
push:
pull_request:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
name: Deploy
permissions:
contents: read
deployments: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Install dependencies (mise)
uses: jdx/mise-action@v2
- name: Build & deploy (production)
uses: cloudflare/wrangler-action@v3
if: github.ref == 'refs/heads/main'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
wranglerVersion: 4.33.1
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- name: Build & deploy (preview)
uses: cloudflare/wrangler-action@v3
if: github.ref != 'refs/heads/main'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
wranglerVersion: 4.33.1
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
command: versions upload --preview-alias ${{ github.head_ref || github.ref_name }}
- name: Update deployment status (successs)
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ success() && github.event_name == 'pull_request' }}
with:
message: |
## :blue_heart: Build successful! :blue_heart:
Preview deployment: https://${{ github.head_ref || github.ref_name }}-bluebuild-website.xyny.workers.dev/
- name: Update deployment status (failure)
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ failure() && github.event_name == 'pull_request' }}
with:
message: |
## :red_circle: Build unsuccessful... :red_circle:
Preview deployment: https://${{ github.head_ref || github.ref_name }}-bluebuild-website.xyny.workers.dev/
- name: Trigger schema rebuild
run: echo "schemas:" && curl -X POST -d {} ${{ secrets.SCHEMAS_DEPLOY_HOOK }}