-
Notifications
You must be signed in to change notification settings - Fork 2
38 lines (36 loc) · 1.66 KB
/
Copy pathdeploy.yml
File metadata and controls
38 lines (36 loc) · 1.66 KB
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
name: Deploy Worker
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v5
- run: npm ci
- name: Build & Deploy Worker
uses: cloudflare/wrangler-action@v3
id: deploy
with:
# Check https://developers.cloudflare.com/workers/ci-cd/external-cicd/github-actions/
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# Add a message to the deployment with the commit
command: versions upload --message "Deployed via GitHub Actions - commit ${{ github.sha }}"
- name: Get deployment URL
id: get-url
env:
WRANGLER_OUTPUT: ${{ steps.deploy.outputs.command-output }}
run: |
URL=$(echo "$WRANGLER_OUTPUT" | awk '/Version Preview URL:/ {gsub(/.*Version Preview URL: /, ""); print}')
echo "deployment-url=$URL" >> $GITHUB_OUTPUT
- name: Register Restate deployment
env:
# Admin URL of your Cloud environment. You can find it in Developers > Admin URL: https://cloud.restate.dev/to/developers/integration#admin
RESTATE_ADMIN_URL: ${{ secrets.RESTATE_ADMIN_URL }}
# Auth token with Admin Role. To get one, go to Developers > API Keys > Create API Key: https://cloud.restate.dev?createApiKey=true&createApiKeyDescription=deployment-key&createApiKeyRole=rst:role::AdminAccess
RESTATE_AUTH_TOKEN: ${{ secrets.RESTATE_AUTH_TOKEN }}
run: npx -y @restatedev/restate deployment register -y ${{ steps.get-url.outputs.deployment-url }}