Skip to content

Commit bb54a07

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 bb54a07

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,6 @@ jobs:
114114
username: ${{ github.repository_owner }}
115115
password: ${{ secrets.GITHUB_TOKEN }}
116116

117-
- uses: docker/setup-buildx-action@v3
118-
- name: Login to DockerHub
119-
uses: docker/login-action@v3
120-
with:
121-
username: ${{ secrets.DOCKERHUB_USERNAME }}
122-
password: ${{ secrets.DOCKERHUB_TOKEN }}
123-
124117
- name: Extract Docker metadata
125118
id: meta
126119
uses: docker/metadata-action@v5
@@ -165,18 +158,20 @@ jobs:
165158
166159
- name: Deploy to Kubernetes
167160
run: |
168-
sed "s|/website:latest|/website:${{ vars.DOCKER_IMAGE_TAG }}|g" deploy/deployment.yaml | \
161+
sed "s|/website:latest|/website:sha-${GITHUB_SHA::7}|g" deploy/deployment.yaml | \
169162
kubectl apply -f - \
170163
-f deploy/service.yaml \
171164
-f deploy/routes.yaml
172165
166+
kubectl rollout status deployment/httptoolkit-website -n httptoolkit-website
167+
173168
- name: Redeploy container
174169
uses: httptoolkit/deploy-scaleway-serverless-container-action@v1
175170
with:
176171
container_id: ${{ vars.SCW_API_CONTAINER_ID }}
177172
region: ${{ vars.SCW_API_CONTAINER_REGION }}
178173
secret_key: ${{ secrets.SCW_SECRET_KEY }}
179-
registry_image_url: "registry.hub.docker.com/httptoolkit/website:${{ vars.DOCKER_IMAGE_TAG }}"
174+
registry_image_url: "ghcr.io/httptoolkit/website:${{ vars.DOCKER_IMAGE_TAG }}"
180175

181176
- name: Redeploy failover container
182177
uses: httptoolkit/deploy-scaleway-serverless-container-action@v1
@@ -185,7 +180,7 @@ jobs:
185180
container_id: ${{ vars.SCW_FAILOVER_API_CONTAINER_ID }}
186181
region: ${{ vars.SCW_FAILOVER_API_CONTAINER_REGION }}
187182
secret_key: ${{ secrets.SCW_SECRET_KEY }}
188-
registry_image_url: "registry.hub.docker.com/httptoolkit/website:${{ vars.DOCKER_IMAGE_TAG }}"
183+
registry_image_url: "ghcr.io/httptoolkit/website:${{ vars.DOCKER_IMAGE_TAG }}"
189184

190185
- name: Flush CDN cache
191186
if: ${{ vars.BUNNY_PULL_ZONE_ID }}

0 commit comments

Comments
 (0)