-
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (73 loc) · 2.64 KB
/
discord-build.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Create and publish Discord workers
on:
workflow_call:
inputs:
environment:
required: true
type: string
skip_deploy:
required: true
type: string
deploy_commands:
required: true
type: string
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
name: Deploy
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7
run_install: false
- uses: actions/setup-node@v3
with:
node-version: 18.3
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Migrate db
if: inputs.skip_deploy != 'true'
#uses: cloudflare/[email protected]
run: npx wrangler d1 migrations apply frugal --env staging
working-directory: ./apps/discord
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}
- name: Turbo build
if: inputs.deploy_commands == 'true'
run: npx turbo build --no-cache
working-directory: ./apps/discord
env:
DISCORD_APP_ID: ${{ secrets.DISCORD_APPLICATION_ID }}
DISCORD_PUBLIC_KEY: ${{ secrets.DISCORD_PUBLIC_KEY }}
DISCORD_SECRET: ${{ secrets.DISCORD_SECRET }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_TOKEN }}
- name: Deploy commands
if: inputs.deploy_commands == 'true'
run: pnpm run sync
working-directory: ./apps/discord
env:
DISCORD_APP_ID: ${{ secrets.DISCORD_APPLICATION_ID }}
DISCORD_PUBLIC_KEY: ${{ secrets.DISCORD_PUBLIC_KEY }}
DISCORD_SECRET: ${{ secrets.DISCORD_SECRET }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_TOKEN }}
- name: Publish
# uses: cloudflare/[email protected]
if: inputs.skip_deploy != 'true'
run: npx wrangler publish --env ${{ inputs.environment }}
working-directory: ./apps/discord
env:
SENTRY_DSN: ${{ secrets.SENTRY_DSN_WORKERS }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT_WORKERS }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
DISCORD_BOT_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISCORD_APP_ID: ${{ secrets.DISCORD_APPLICATION_ID }}
DISCORD_PUBLIC_KEY: ${{ secrets.DISCORD_PUBLIC_KEY }}
SUMMARY_SITE: ${{ secrets.SUMMARY_SITE }}
ENVIROMENT: ${{ inputs.environment }}
RELEASE: ${{ github.sha }}
BRANCH: ${{ env.GITHUB_REF_NAME }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CF_API_TOKEN }}