Skip to content

.github/workflows/deploy-worker.yml #15

.github/workflows/deploy-worker.yml

.github/workflows/deploy-worker.yml #15

Workflow file for this run

on:
workflow_dispatch:
inputs:
appId:
description: 'Worker App ID'
required: true
repo:
description: 'GitHub repository name'
required: true
commit:
description: 'Git commit hash'
required: true
directory:
description: 'Directory to deploy'
required: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: ${{github.event.inputs.appId}}
run: echo run identifier ${{ github.run_id }}
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.inputs.repo }}
ref: ${{ github.event.inputs.branch }}
- name: Deploy Worker
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
workingDirectory: ${{ github.event.inputs.directory }}
command: deploy --name=${{ github.event.inputs.appId }}
# - name: Webhook on Success
# if: success()
# run: |
# curl -X POST -H "Content-Type: application/json" -d '{"status": "success"}' YOUR_WEBHOOK_URL_ON_SUCCESS
# env:
# YOUR_WEBHOOK_URL_ON_SUCCESS: ${{ secrets.YOUR_WEBHOOK_URL_ON_SUCCESS }}
# - name: Webhook on Failure
# if: failure()
# run: |
# curl -X POST -H "Content-Type: application/json" -d '{"status": "failure"}' YOUR_WEBHOOK_URL_ON_FAILURE
# env:
# YOUR_WEBHOOK_URL_ON_FAILURE: ${{ secrets.YOUR_WEBHOOK_URL_ON_FAILURE }}