@@ -35,18 +35,16 @@ jobs:
35
35
username : ${{ github.repository_owner }}
36
36
password : ${{ secrets.GITHUB_TOKEN }}
37
37
38
- - name : Build main sliding sync image
39
- if : github.ref_name == 'main'
40
- id : docker_build_sliding_sync
41
- uses : docker/build-push-action@v4
38
+ - name : Generate docker image tags
39
+ id : metadata
40
+ uses : docker/metadata-action@v5
42
41
with :
43
- cache-from : type=gha
44
- cache-to : type=gha,mode=max
45
- context : .
46
- platforms : ${{ env.PLATFORMS }}
47
- push : true
42
+ images : |
43
+ name=ghcr.io/${{ github.repository_owner }}/${{ github.repository }}
48
44
tags : |
49
- ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:main
45
+ ${{ github.ref_name == 'main' && 'type=raw,value=main' }}
46
+ ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) && 'type=raw,value=latest' }}
47
+ type=raw,value=${{ github.ref_name }}
50
48
51
49
- name : Build release Sliding Sync image
52
50
if : github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
58
56
context : .
59
57
platforms : ${{ env.PLATFORMS }}
60
58
push : true
61
- tags : |
62
- ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:latest
63
- ghcr.io/${{ env.GHCR_NAMESPACE }}/sliding-sync:${{ github.ref_name }}
59
+ tags : ${{ steps.metadata.outputs.tags }}
60
+ labels : ${{ steps.metadata.outputs.labels }}
64
61
65
62
- name : Run Trivy vulnerability scanner
66
63
uses : aquasecurity/trivy-action@master
0 commit comments