Skip to content

Commit 121b82d

Browse files
committed
ci: Prevent rebuilding base always and bump actions
1 parent 961f2e9 commit 121b82d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/docker.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ on:
88
jobs:
99
docker:
1010
runs-on: ubuntu-latest
11-
timeout-minutes: 120
11+
timeout-minutes: 60
12+
if: github.event_name != 'pull_request'
1213
permissions:
1314
packages: write
1415
strategy:
@@ -31,8 +32,9 @@ jobs:
3132
password: ${{ secrets.GITHUB_TOKEN }}
3233

3334
- name: Build and push the base image
34-
uses: docker/build-push-action@v5
35-
if: success() && github.event_name != 'pull_request'
35+
id: base_build
36+
uses: docker/build-push-action@v6
37+
if: startsWith(github.event.head_commit.message, '[build-base]:')
3638
with:
3739
context: .
3840
file: Dockerfile.base
@@ -50,6 +52,7 @@ jobs:
5052
cache-to: type=gha,mode=max
5153

5254
- name: Create and push the base manifest
55+
if: steps.base_build.outcome == 'success'
5356
run: |
5457
docker manifest create \
5558
ghcr.io/${{ github.repository }}-base:${{ github.sha }} \
@@ -64,8 +67,8 @@ jobs:
6467
docker manifest push ghcr.io/${{ github.repository }}-base:latest
6568
6669
- name: Build and push the image
67-
uses: docker/build-push-action@v5
68-
if: success() && github.event_name != 'pull_request'
70+
uses: docker/build-push-action@v6
71+
id: image_build
6972
with:
7073
context: .
7174
file: Dockerfile
@@ -83,6 +86,7 @@ jobs:
8386
cache-to: type=gha,mode=max
8487

8588
- name: Create and push manifest
89+
if: steps.image_build.outcome == 'success'
8690
run: |
8791
docker manifest create \
8892
ghcr.io/${{ github.repository }}:${{ github.sha }} \

0 commit comments

Comments
 (0)