-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.66 KB
/
Copy pathdeploy.yml
File metadata and controls
51 lines (43 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
39
40
41
42
43
44
45
46
47
48
49
50
51
run-name: Deploy to Cloudflare
on:
workflow_call:
inputs:
environment:
required: true
type: string
jobs:
deploy:
name: Deploy to Cloudflare
runs-on: ubuntu-latest
if: true == false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@ridetracker'
- name: Authenticate with GitHub Package Registry
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
# Skip post-install scripts here, as a malicious script could steal NODE_AUTH_TOKEN.
- run: npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# `npm rebuild` will run all those post-install scripts for us.
- name: Run post-install scripts
run: "npm rebuild && npm run prepare --if-present"
shell: bash
- name: Publish using wrangler
uses: cloudflare/wrangler-action@2.0.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_WORKERS_TOKEN }}
command:
publish
--env ${{ inputs.environment }}
--var
GITHUB_SHA:${{ github.sha }}
CLOUDFLARE_ACCOUNT_ID:${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_IMAGES_TOKEN:${{ secrets.CLOUDFLARE_API_IMAGES_TOKEN }}
GOOGLE_MAPS_API_TOKEN:${{ secrets.GOOGLE_MAPS_API_TOKEN }}
ANALYTICS_SERVICE_CLIENT_ID:${{ vars.ANALYTICS_CLIENT_ID }}
ANALYTICS_SERVICE_CLIENT_TOKEN:${{ secrets.ANALYTICS_CLIENT_TOKEN }}