Skip to content

Commit fe4ff0f

Browse files
authored
Update docker-publish.yml - if one job fails, continue with others; use docker metadata
1 parent 5f790b2 commit fe4ff0f

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/docker-publish.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ jobs:
5050

5151
build:
5252
needs: get-tags
53+
continue-on-error: true
5354
strategy:
5455
matrix:
5556
branch:
@@ -80,18 +81,29 @@ jobs:
8081
username: ${{ secrets.DOCKERHUB_USERNAME }}
8182
password: ${{ secrets.DOCKERHUB_TOKEN }}
8283

84+
# Extract metadata (tags, labels) for Docker
85+
# https://github.com/docker/metadata-action
86+
- name: Extract Docker metadata
87+
id: docker_meta
88+
uses: docker/metadata-action@v5.6.1
89+
with:
90+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
91+
tags: |
92+
type=raw,value=${{ matrix.branch }}
93+
flavor: |
94+
suffix=-${{ matrix.webserver }}
95+
8396
# Build and push Docker image with Buildx (don't push on PR)
8497
# https://github.com/docker/build-push-action
8598
- name: Build and push Docker image
8699
id: build-and-push
87-
uses: docker/build-push-action@v6
100+
uses: docker/build-push-action@v6.12.0
88101
with:
89102
context: .
90103
build-args: |
91104
BRANCH=${{ matrix.branch }}
92-
push: true
93-
tags: |
94-
jessebot/pixelfed-glitch
105+
push: ${{ github.event_name != 'pull_request' }}
106+
tags: ${{ steps.docker_meta.outputs.tags }}
95107
labels: ${{ steps.docker_meta.outputs.labels }}
96108
cache-from: type=gha
97109
cache-to: type=gha,mode=max

0 commit comments

Comments
 (0)