Skip to content

Commit

Permalink
Add metadata-action so labels are generated
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Mogan <git@gavinmogan.com>
  • Loading branch information
halkeye committed Apr 26, 2024
1 parent 8c76aad commit 8bcd28b
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,16 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build main sliding sync image
if: github.ref_name == 'main'
id: docker_build_sliding_sync
uses: docker/build-push-action@v4
- name: Generate docker image tags
id: metadata
uses: docker/metadata-action@v5
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
platforms: ${{ env.PLATFORMS }}
push: true
images: |
name=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
tags: |
ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:main
${{ github.ref_name == 'main' && 'type=raw,value=main' }}
${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) && 'type=raw,value=latest' }}
type=raw,value=${{ github.ref_name }}
- name: Build release Sliding Sync image
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
Expand All @@ -58,9 +56,8 @@ jobs:
context: .
platforms: ${{ env.PLATFORMS }}
push: true
tags: |
ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:latest
ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:${{ github.ref_name }}
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}

- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
Expand Down

0 comments on commit 8bcd28b

Please sign in to comment.