Skip to content

Commit ce9bfa7

Browse files
committed
Improve CI handling of Dependabot pushes & split CI scaleway deploy
1 parent f2122c8 commit ce9bfa7

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ jobs:
7979
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
8080
timeout-minutes: 1
8181

82-
publish-scaleway:
83-
name: Deploy to Docker Hub & Scaleway
84-
if: github.event_name != 'pull_request'
82+
publish-docker:
83+
name: Build & publish container to Docker Hub
84+
if: github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/dependabot/')
8585
runs-on: ubuntu-latest
8686
container: httptoolkit/act-build-base
8787
needs: build
@@ -95,7 +95,6 @@ jobs:
9595

9696
- uses: docker/setup-buildx-action@v2
9797
- name: Login to DockerHub
98-
if: github.event_name != 'pull_request'
9998
uses: docker/login-action@v2
10099
with:
101100
username: ${{ secrets.DOCKERHUB_USERNAME }}
@@ -112,14 +111,21 @@ jobs:
112111
type=raw,value=latest,enable={{is_default_branch}}
113112
type=sha
114113
115-
- name: Publish to Docker Hub
114+
- name: Build and publish to Docker Hub
116115
uses: docker/build-push-action@v4
117116
with:
118117
context: .
119-
push: ${{ github.event_name != 'pull_request' }}
118+
push: ${{ github.event_name == 'push' }}
120119
tags: ${{ steps.meta.outputs.tags }}
121120
labels: ${{ steps.meta.outputs.labels }}
122121

122+
publish-scaleway:
123+
name: Deploy to Scaleway
124+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
125+
runs-on: ubuntu-latest
126+
container: httptoolkit/act-build-base
127+
needs: publish-docker
128+
steps:
123129
- name: Redeploy container
124130
uses: thibaultchazal/scaleway-serverless-container-deploy-action@0d290edda0c3359e51442bd8bf730eafef4e290f
125131
with:
@@ -128,7 +134,6 @@ jobs:
128134
registry_image_url: "registry.hub.docker.com/httptoolkit/ui:prod"
129135

130136
- name: Flush CDN cache
131-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
132137
run: |
133138
# Clear CDN cache to re-request content:
134139
curl -f --request POST \

0 commit comments

Comments
 (0)