-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.55 KB
/
deploy-worker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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 }}