Skip to content

Commit 27c175c

Browse files
committed
update
1 parent df4d829 commit 27c175c

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
CODER_BASE_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_BASE_IMAGE_TAG }}
4747
CODER_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_IMAGE_TAG }}
4848
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' }}
5050

5151
runs-on: "ubuntu-latest"
5252
steps:
@@ -158,7 +158,7 @@ jobs:
158158
build:
159159
needs: get_info
160160
# 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'
162162
runs-on: ${{ github.repository_owner == 'coder' && 'buildjet-8vcpu-ubuntu-2204' || 'ubuntu-latest' }}
163163
env:
164164
DOCKER_CLI_EXPERIMENTAL: "enabled"
@@ -227,19 +227,18 @@ jobs:
227227
export KUBECONFIG=~/.kube/config
228228
229229
- 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'
231231
run: |
232232
set -euo pipefail
233233
foundTag=$(curl -fsSL https://github.com/coder/coder/pkgs/container/coder-preview | grep -o ${{ env.CODER_IMAGE_TAG }} | head -n 1)
234234
if [ -z "$foundTag" ]; then
235235
echo "Image not found"
236236
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"
238237
exit 1
239238
fi
240239
241240
- 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'
243242
run: |
244243
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.PR_DEPLOYMENTS_ZONE_ID }}/dns_records" \
245244
-H "Authorization: Bearer ${{ secrets.PR_DEPLOYMENTS_CLOUDFLARE_API_TOKEN }}" \
@@ -252,15 +251,15 @@ jobs:
252251
ref: ${{ env.PR_BRANCH }}
253252

254253
- 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'
256255
run: |
257256
set -euo pipefail
258257
# try to delete the namespace, but don't fail if it doesn't exist
259258
kubectl delete namespace "pr${{ env.PR_NUMBER }}" || true
260259
kubectl create namespace "pr${{ env.PR_NUMBER }}"
261260
262261
- 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'
264263
run: |
265264
# Using kubectl to check if a Certificate resource already exists
266265
# we are doing this to avoid letsenrypt rate limits
@@ -283,7 +282,7 @@ jobs:
283282
)
284283
285284
- 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'
287286
run: |
288287
helm repo add bitnami https://charts.bitnami.com/bitnami
289288
helm install coder-db bitnami/postgresql \
@@ -296,7 +295,7 @@ jobs:
296295
--from-literal=url="postgres://coder:coder@coder-db-postgresql.pr${{ env.PR_NUMBER }}.svc.cluster.local:5432/coder?sslmode=disable"
297296
298297
- 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'
300299
run: |
301300
set -euo pipefail
302301
# Create service account, role, rolebinding and secret
@@ -345,15 +344,15 @@ jobs:
345344
fi
346345
347346
- 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'
349348
run: |
350349
helm repo add coder-logstream-kube https://helm.coder.com/logstream-kube
351350
helm upgrade --install coder-logstream-kube coder-logstream-kube/coder-logstream-kube \
352351
--namespace "pr${{ env.PR_NUMBER }}" \
353352
--set url="https://pr${{ env.PR_NUMBER }}.${{ secrets.PR_DEPLOYMENTS_DOMAIN }}"
354353
355354
- 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'
357356
run: |
358357
set -euo pipefail
359358
@@ -379,7 +378,7 @@ jobs:
379378
mv "${DEST}" /usr/local/bin/coder
380379
381380
- 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'
383382
id: setup_deployment
384383
run: |
385384
set -euo pipefail
@@ -416,7 +415,7 @@ jobs:
416415
coder stop kube -y
417416
418417
- 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'
420419
run: |
421420
curl -s -o /dev/null -X POST -H 'Content-type: application/json' \
422421
-d \

0 commit comments

Comments
 (0)