Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/publish-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
description: "Tag to build and publish the image for"
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_PASSWORD:
required: true
workflow_dispatch:
inputs:
tag:
Expand Down Expand Up @@ -47,12 +52,20 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to Docker Hub
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Image metadata
id: meta
uses: docker/metadata-action@v6
with:
context: git
images: ghcr.io/darksworm/doormouse
images: |
ghcr.io/darksworm/doormouse
${{ secrets.DOCKERHUB_USERNAME }}/doormouse
tags: |
type=semver,pattern={{version}},value=${{ inputs.tag }}
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.tag }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ jobs:
if: ${{ needs.release-please.outputs.release_created == 'true' }}
uses: ./.github/workflows/test.yml

# No `secrets: inherit`: the called workflow needs nothing beyond
# GITHUB_TOKEN, which reusable workflows always get, and inheriting would
# hand it RELEASE_PLEASE_TOKEN for no reason.
#
# Pass only the Docker Hub credentials required by the reusable workflow.
# If this job fails, the tag and the draft release already exist, so a later
# push to main will not retry it — release-please only reports
# release_created once. Re-run the publish-image workflow directly instead; it
Expand All @@ -53,3 +50,6 @@ jobs:
uses: ./.github/workflows/publish-image.yml
with:
tag: ${{ needs.release-please.outputs.tag_name }}
secrets:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
Loading