Skip to content

Commit a0caca3

Browse files
committed
Set up autodeploy to Scaleway
1 parent 4a36ef0 commit a0caca3

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ jobs:
7575
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
7676
timeout-minutes: 1
7777

78-
publish-hidora:
79-
name: Deploy to Docker Hub & Hidora
78+
publish-scaleway:
79+
name: Deploy to Docker Hub & Scaleway
8080
if: github.event_name != 'pull_request'
8181
runs-on: ubuntu-latest
8282
container: httptoolkit/act-build-base
@@ -108,28 +108,27 @@ jobs:
108108
type=raw,value=latest,enable={{is_default_branch}}
109109
type=sha
110110
111-
- name: Deploy to Docker Hub
111+
- name: Publish to Docker Hub
112112
uses: docker/build-push-action@v2
113113
with:
114114
context: .
115115
push: ${{ github.event_name != 'pull_request' }}
116116
tags: ${{ steps.meta.outputs.tags }}
117117
labels: ${{ steps.meta.outputs.labels }}
118118

119-
- name: Redeploy site
119+
- name: Redeploy container
120+
uses: thibaultchazal/scaleway-serverless-container-deploy-action@0d290edda0c3359e51442bd8bf730eafef4e290f
121+
with:
122+
container_id: ${{ vars.SCW_API_CONTAINER_ID }}
123+
secret_key: ${{ secrets.SCW_SECRET_KEY }}
124+
registry_image_url: "registry.hub.docker.com/httptoolkit/ui:prod"
125+
126+
- name: Flush CDN cache
120127
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
121128
run: |
122-
sleep 30 # Wait for Docker Hub to fully publish
123-
124-
# Trigger a container redeploy:
125-
curl "https://app.hidora.com/1.0/environment/control/rest/redeploycontainersbygroup?session=$HIDORA_API_TOKEN&envName=htk-ui&nodeGroup=cp&tag=prod&useExistingVolumes=true" | \
126-
tee /dev/stderr | \
127-
grep -q 'Node has been successfully updated'
128-
129129
# Clear CDN cache to re-request content:
130130
curl -f --request POST \
131131
--url https://api.bunny.net/pullzone/1110200/purgeCache \
132132
--header "AccessKey: $BUNNY_SITE_API_KEY"
133133
env:
134-
HIDORA_API_TOKEN: ${{ secrets.HIDORA_API_TOKEN }}
135134
BUNNY_SITE_API_KEY: ${{ secrets.BUNNY_SITE_API_KEY }}

0 commit comments

Comments
 (0)