-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.38 KB
/
deploy.yml
File metadata and controls
40 lines (33 loc) · 1.38 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
run-name: Deploy to Cloudflare
on:
workflow_call:
inputs:
environment:
required: true
type: string
jobs:
deploy:
name: Deploy to Cloudflare
runs-on: ubuntu-latest
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 }} DISCORD_BOT_CLIENT_ID:${{ secrets.DISCORD_BOT_CLIENT_ID }} DISCORD_BOT_CLIENT_TOKEN:${{ secrets.DISCORD_BOT_CLIENT_TOKEN }} DISCORD_CHANNEL_ID:${{ vars.DISCORD_CHANNEL_ID }} DISCORD_USER_ID:${{ vars.DISCORD_USER_ID }}