Skip to content

Commit 7069394

Browse files
authored
ci: set fail-fast to false in docker.yml (ggml-org#3294)
* ci: set fail-fast to false in docker.yml This commit modifies the GitHub Actions workflow for Docker builds to disable the fail-fast behavior. The motivation for this is that currently if one of the strategy jobs fails any other job that is in progress will be cancelled. There is no need for this as the jobs are independent. * ci : update docker.yml to use a single build This commit updates the docker job to only build the image once instead of twice (only happens when pushing to the master branch). Instead this will tag the image with the commit SHA when pushing to master. The motivation for this change is to reduce the time it takes to run this job and also it might help with the disk space issues we are experiencing for this job when it runs on pushes to master.
1 parent f8abbeb commit 7069394

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/docker.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
env:
1616
COMMIT_SHA: ${{ github.sha }}
1717
strategy:
18+
fail-fast: false
1819
matrix:
1920
config:
2021
- { tag: "main", dockerfile: ".devops/main.Dockerfile", platform: "linux/amd64" }
@@ -41,21 +42,20 @@ jobs:
4142
username: ${{ github.repository_owner }}
4243
password: ${{ secrets.GITHUB_TOKEN }}
4344

44-
- name: Build and push Docker image (versioned)
45-
if: github.event_name == 'push'
46-
uses: docker/build-push-action@v5
47-
with:
48-
context: .
49-
push: true
50-
platforms: ${{ matrix.config.platform }}
51-
tags: "ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"
52-
file: ${{ matrix.config.dockerfile }}
45+
- name: Generate tags
46+
id: tags
47+
run: |
48+
TAGS="ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}"
49+
if [ "${{ github.event_name }}" == "push" ]; then
50+
TAGS="$TAGS,ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}-${{ env.COMMIT_SHA }}"
51+
fi
52+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
5353
5454
- name: Build and push Docker image (tagged)
55-
uses: docker/build-push-action@v4
55+
uses: docker/build-push-action@v5
5656
with:
5757
context: .
5858
push: ${{ github.event_name == 'push' }}
5959
platforms: ${{ matrix.config.platform }}
60-
tags: "ghcr.io/${{ github.repository }}:${{ matrix.config.tag }}"
60+
tags: ${{ steps.tags.outputs.tags }}
6161
file: ${{ matrix.config.dockerfile }}

0 commit comments

Comments
 (0)