Skip to content

Commit

Permalink
chore: simplify image list maker
Browse files Browse the repository at this point in the history
  • Loading branch information
septs committed Jun 22, 2024
1 parent 4522991 commit 47a8703
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ jobs:
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
id: ghcr
continue-on-error: true
uses: docker/login-action@v3
with:
registry: ghcr.io
Expand All @@ -55,20 +57,13 @@ jobs:
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Make image list
id: images
run: |
echo 'images<<EOF' >> "$GITHUB_OUTPUT"
echo 'ghcr.io/${{ github.repository }}' >> "$GITHUB_OUTPUT"
if ${{ steps.dockerhub.outcome == 'success' }}; then
echo 'docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }}' >> "$GITHUB_OUTPUT"
fi
echo 'EOF' >> "$GITHUB_OUTPUT"
- name: Metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ steps.images.outputs.images }}
images: |
ghcr.io/${{ github.repository }},enable=${{ steps.ghcr.outcome == 'success' }}
docker.io/${{ secrets.DOCKERHUB_USERNAME }}/${{ github.event.repository.name }},enable=${{ steps.dockerhub.outcome == 'success' }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=semver,pattern={{version}}
Expand Down

0 comments on commit 47a8703

Please sign in to comment.