-
Notifications
You must be signed in to change notification settings - Fork 511
172 lines (149 loc) · 4.83 KB
/
deploy.yaml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
name: Deploy
on:
push:
branches: [main]
concurrency:
group: deploy
cancel-in-progress: false
jobs:
agent_local_test:
uses: ./.github/workflows/test_agent_local.yaml
build_agent_image:
uses: ./.github/workflows/job_build_agent_image.yaml
secrets:
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}
agent_production_deployment:
needs:
- build_agent_image
- api_preview_test
- agent_staging_deployment
uses: ./.github/workflows/job_deploy_agent_production.yaml
secrets:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
AXIOM_TOKEN: ${{ secrets.AXIOM_TOKEN }}
api_local_test:
name: Test API
uses: ./.github/workflows/job_test_api_local.yaml
api_preview_deployment:
needs:
- api_local_test
uses: ./.github/workflows/job_deploy_api_staging.yaml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
agent_staging_deployment:
needs:
- build_agent_image
uses: ./.github/workflows/job_deploy_agent_staging.yaml
secrets:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
api_preview_test:
needs:
- agent_staging_deployment
- api_preview_deployment
uses: ./.github/workflows/job_test_api_staging.yaml
with:
UNKEY_BASE_URL: https://preview-api.unkey.dev
secrets:
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
api_canary_deployment:
needs:
- api_local_test
- api_preview_test
uses: ./.github/workflows/job_deploy_api_canary.yaml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
api_canary_test:
needs:
- api_canary_deployment
- agent_production_deployment
uses: ./.github/workflows/job_test_api_canary.yaml
with:
UNKEY_BASE_URL: https://canary.unkey.dev
secrets:
DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
# api_canary_benchmark:
# if: ${{false}}
# environment: Canary
# needs:
# - api_canary_deployment
# - agent_production_deployment
# strategy:
# fail-fast: false
# matrix:
# region: [
# "us-east-1",
# "us-east-2",
# "us-west-1",
# "us-west-2",
# "ap-south-2",
# "ap-southeast-3",
# "ap-southeast-4",
# "ap-south-1",
# "ap-northeast-3",
# "ap-northeast-2",
# "ap-southeast-1",
# "ap-southeast-2", # sydney
# "ca-central-1", # Canada
# "eu-central-1", # Frankfurt
# "eu-west-2", # London
# "sa-east-1", # Sao Paulo,
# ]
# name: Artillery in ${{ matrix.region }}
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Prepare
# shell: bash
# run: |
# cat <<EOF > .keys.csv
# ${{ secrets.ARTILLERY_KEYS_CSV }}
# EOF
# working-directory: tools/artillery
# - name: Run
# run: npx artillery@latest run-lambda --record --key=${{ secrets.ARTILLERY_CLOUD_KEY }} --region ${{ matrix.region }} --count=5 --target=https://canary.unkey.dev ./keys.verifyKey.yaml
# working-directory: tools/artillery
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
api_production_deployment:
needs:
- api_canary_test
- agent_production_deployment
uses: ./.github/workflows/job_deploy_api_production.yaml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
mintlify_deployment:
needs:
- api_production_deployment
runs-on: ubuntu-latest
name: Deploy docs
steps:
- uses: actions/checkout@v4
- name: Redeploy
run: |
curl --request POST \
--url https://api.mintlify.com/v1/project/update/648b83e0e20b94f5a3e41a70 \
--header 'Authorization: Bearer ${{secrets.MINTLIFY_API_KEY}}'
logdrain_production_deployment:
needs:
- api_production_deployment
uses: ./.github/workflows/job_deploy_logdrain_production.yaml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
workflows_deployment:
needs:
- api_local_test
uses: ./.github/workflows/job_deploy_workflows.yaml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# trigger_production_deployment:
# uses: ./.github/workflows/deploy_trigger.yaml
deploy-enterprise-worker:
needs: api_production_deployment
uses: ./.github/workflows/job_deploy_api_enterprise.yaml
secrets:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}