46
46
CODER_BASE_IMAGE_TAG : ${{ steps.set_tags.outputs.CODER_BASE_IMAGE_TAG }}
47
47
CODER_IMAGE_TAG : ${{ steps.set_tags.outputs.CODER_IMAGE_TAG }}
48
48
NEW : ${{ steps.check_deployment.outputs.new }}
49
- BUILD : ${{ steps.filter.outputs.all_count > steps.filter.outputs.ignored_count || steps.check_deployment.outputs.new }}
49
+ BUILD : ${{ steps.filter.outputs.all_count > steps.filter.outputs.ignored_count || steps.check_deployment.outputs.new || github.event.inputs.force == 'true' }}
50
50
51
51
runs-on : " ubuntu-latest"
52
52
steps :
@@ -158,7 +158,7 @@ jobs:
158
158
build :
159
159
needs : get_info
160
160
# Run build job only if there are changes in the files that we care about or if the workflow is manually triggered with --force
161
- if : needs.get_info.outputs.BUILD == 'true' || github.event.inputs.force == 'true'
161
+ if : needs.get_info.outputs.BUILD == 'true'
162
162
runs-on : ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
163
163
env :
164
164
DOCKER_CLI_EXPERIMENTAL : " enabled"
@@ -227,19 +227,18 @@ jobs:
227
227
export KUBECONFIG=~/.kube/config
228
228
229
229
- name : Check if image exists
230
- if : needs.get_info.outputs.NEW == 'true'
230
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
231
231
run : |
232
232
set -euo pipefail
233
233
foundTag=$(curl -fsSL https://github.com/coder/coder/pkgs/container/coder-preview | grep -o ${{ env.CODER_IMAGE_TAG }} | head -n 1)
234
234
if [ -z "$foundTag" ]; then
235
235
echo "Image not found"
236
236
echo "${{ env.CODER_IMAGE_TAG }} not found in ghcr.io/coder/coder-preview"
237
- echo "Please remove --skip-build from the comment and try again"
238
237
exit 1
239
238
fi
240
239
241
240
- name : Add DNS record to Cloudflare
242
- if : needs.get_info.outputs.NEW == 'true'
241
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
243
242
run : |
244
243
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.PR_DEPLOYMENTS_ZONE_ID }}/dns_records" \
245
244
-H "Authorization: Bearer ${{ secrets.PR_DEPLOYMENTS_CLOUDFLARE_API_TOKEN }}" \
@@ -252,15 +251,15 @@ jobs:
252
251
ref : ${{ env.PR_BRANCH }}
253
252
254
253
- name : Create PR namespace
255
- if : needs.get_info.outputs.NEW == 'true'
254
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
256
255
run : |
257
256
set -euo pipefail
258
257
# try to delete the namespace, but don't fail if it doesn't exist
259
258
kubectl delete namespace "pr${{ env.PR_NUMBER }}" || true
260
259
kubectl create namespace "pr${{ env.PR_NUMBER }}"
261
260
262
261
- name : Check and Create Certificate
263
- if : needs.get_info.outputs.NEW == 'true'
262
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
264
263
run : |
265
264
# Using kubectl to check if a Certificate resource already exists
266
265
# we are doing this to avoid letsenrypt rate limits
@@ -283,7 +282,7 @@ jobs:
283
282
)
284
283
285
284
- name : Set up PostgreSQL database
286
- if : needs.get_info.outputs.NEW == 'true'
285
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
287
286
run : |
288
287
helm repo add bitnami https://charts.bitnami.com/bitnami
289
288
helm install coder-db bitnami/postgresql \
@@ -296,7 +295,7 @@ jobs:
296
295
--from-literal=url="postgres://coder:coder@coder-db-postgresql.pr${{ env.PR_NUMBER }}.svc.cluster.local:5432/coder?sslmode=disable"
297
296
298
297
- name : Create a kubeconfig for the workspace
299
- if : needs.get_info.outputs.NEW == 'true'
298
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
300
299
run : |
301
300
set -euo pipefail
302
301
# Create service account, role, rolebinding and secret
@@ -345,15 +344,15 @@ jobs:
345
344
fi
346
345
347
346
- name : Install coder-logstream-kube
348
- if : needs.get_info.outputs.NEW == 'true'
347
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
349
348
run : |
350
349
helm repo add coder-logstream-kube https://helm.coder.com/logstream-kube
351
350
helm upgrade --install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
352
351
--namespace "pr${{ env.PR_NUMBER }}" \
353
352
--set url="https://pr${{ env.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}"
354
353
355
354
- name : Get Coder binary
356
- if : needs.get_info.outputs.NEW == 'true'
355
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
357
356
run : |
358
357
set -euo pipefail
359
358
@@ -379,7 +378,7 @@ jobs:
379
378
mv "${DEST}" /usr/local/bin/coder
380
379
381
380
- name : Create first user, template and workspace
382
- if : needs.get_info.outputs.NEW == 'true'
381
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
383
382
id : setup_deployment
384
383
run : |
385
384
set -euo pipefail
@@ -416,7 +415,7 @@ jobs:
416
415
coder stop kube -y
417
416
418
417
- name : Send Slack notification
419
- if : needs.get_info.outputs.NEW == 'true'
418
+ if : needs.get_info.outputs.NEW == 'true' || github.event.inputs.force == 'true'
420
419
run : |
421
420
curl -s -o /dev/null -X POST -H 'Content-type: application/json' \
422
421
-d \
0 commit comments