@@ -40,13 +40,15 @@ jobs:
40
40
41
41
- name : " Log in to Github Container registry"
42
42
uses : docker/login-action@v3
43
+ if : github.event_name != 'pull_request'
43
44
with :
44
45
registry : ghcr.io
45
46
username : ${{ github.actor }}
46
47
password : ${{ secrets.GITHUB_TOKEN }}
47
48
48
49
- name : " Log in to quay"
49
50
uses : docker/login-action@v3
51
+ if : github.event_name != 'pull_request'
50
52
with :
51
53
registry : quay.io
52
54
username : wxpe+github_pusher_bot
@@ -73,15 +75,25 @@ jobs:
73
75
fi
74
76
echo "CACHE_TO=$CACHE_TO" >> $GITHUB_ENV
75
77
76
- - name : " push tags"
77
- run : echo "PUSH_TAGS=$(scripts/get_image_tags.sh ${QUAY_REPOSITORY} | tr -s '[:blank:]' ',')" >> $GITHUB_ENV
78
+ - name : " Generate tags"
79
+ id : meta
80
+ uses : docker/metadata-action@v5
81
+ with :
82
+ images : |
83
+ ${{ env.QUAY_REPOSITORY }}
84
+ tags : |
85
+ type=ref,event=branch
86
+ type=semver,pattern={{version}}
87
+ type=semver,pattern={{major}}.{{minor}}
88
+ type=sha,enable=true,priority=100,prefix=,suffix=,format=short
89
+ type=sha,enable=true,priority=100,prefix=${{ github.ref_name }}.,suffix=,format=short
78
90
79
91
- name : " Build and push"
80
92
uses : docker/build-push-action@v5
81
93
with :
82
94
context : .
83
95
target : router-release
84
- tags : ${{ env.PUSH_TAGS }}
96
+ tags : ${{ steps.meta.outputs.tags }}
85
97
cache-from : type=registry,ref=${{ env.CACHE_IMAGE }}
86
98
cache-to : ${{ env.CACHE_TO }}
87
99
push : ${{ github.event_name != 'pull_request' }}
0 commit comments