Skip to content

Commit 3f275db

Browse files
committed
Improve k8s deployment setup
We now use the sha explicitly rather than the confusing GH var (I think this is just set to 'prod' anyway) and we actively listen for the deployment to complete.
1 parent f84e71e commit 3f275db

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,18 +165,20 @@ jobs:
165165
166166
- name: Deploy to Kubernetes
167167
run: |
168-
sed "s|/website:latest|/website:${{ vars.DOCKER_IMAGE_TAG }}|g" deploy/deployment.yaml | \
168+
sed "s|/website:latest|/website:sha-${GITHUB_SHA::7}|g" deploy/deployment.yaml | \
169169
kubectl apply -f - \
170170
-f deploy/service.yaml \
171171
-f deploy/routes.yaml
172172
173+
kubectl rollout status deployment/httptoolkit-website -n httptoolkit-website
174+
173175
- name: Redeploy container
174176
uses: httptoolkit/deploy-scaleway-serverless-container-action@v1
175177
with:
176178
container_id: ${{ vars.SCW_API_CONTAINER_ID }}
177179
region: ${{ vars.SCW_API_CONTAINER_REGION }}
178180
secret_key: ${{ secrets.SCW_SECRET_KEY }}
179-
registry_image_url: "registry.hub.docker.com/httptoolkit/website:${{ vars.DOCKER_IMAGE_TAG }}"
181+
registry_image_url: "registry.hub.docker.com/httptoolkit/website:sha-${GITHUB_SHA::7}"
180182

181183
- name: Redeploy failover container
182184
uses: httptoolkit/deploy-scaleway-serverless-container-action@v1
@@ -185,7 +187,7 @@ jobs:
185187
container_id: ${{ vars.SCW_FAILOVER_API_CONTAINER_ID }}
186188
region: ${{ vars.SCW_FAILOVER_API_CONTAINER_REGION }}
187189
secret_key: ${{ secrets.SCW_SECRET_KEY }}
188-
registry_image_url: "registry.hub.docker.com/httptoolkit/website:${{ vars.DOCKER_IMAGE_TAG }}"
190+
registry_image_url: "registry.hub.docker.com/httptoolkit/website:sha-${GITHUB_SHA::7}"
189191

190192
- name: Flush CDN cache
191193
if: ${{ vars.BUNNY_PULL_ZONE_ID }}

0 commit comments

Comments
 (0)