@@ -14,21 +14,38 @@ jobs:
14
14
- name : Set up Docker Buildx
15
15
uses : docker/setup-buildx-action@v3
16
16
- name : Get image repository
17
- run : echo IMAGE_REPOSITORY=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
17
+ run : |
18
+ echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
19
+ echo GHCR_IMAGE_REPOSITORY=$(echo ghcr.io/${{ github.actor }}/${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
18
20
- name : Get the release
19
21
run : echo RELEASE=${GITHUB_REF/refs\/tags\//} >> $GITHUB_ENV
20
22
- name : Login to Docker Registry
21
23
uses : docker/login-action@v3
22
24
with :
23
25
username : ${{ secrets.DOCKER_USERNAME }}
24
26
password : ${{ secrets.DOCKER_PASSWORD }}
27
+ - name : Login to GitHub Container Registry
28
+ uses : docker/login-action@v3
29
+ with :
30
+ registry : ghcr.io
31
+ username : ${{ github.actor }}
32
+ password : ${{ secrets.GITHUB_TOKEN }}
33
+ - name : Docker meta
34
+ id : meta
35
+ uses : docker/metadata-action@v5
36
+ with :
37
+ images : |
38
+ ${{ env.DOCKER_IMAGE_REPOSITORY }}
39
+ ${{ env.GHCR_IMAGE_REPOSITORY }}
40
+ tags : |
41
+ type=raw,value=${{ env.RELEASE }}
42
+ type=raw,value=stable
43
+ type=raw,value=latest
25
44
- name : Build and push Docker image
26
45
uses : docker/build-push-action@v6
27
46
with :
28
47
platforms : linux/amd64,linux/arm/v7,linux/arm64
29
48
pull : true
30
49
push : true
31
- tags : |
32
- ${{ env.IMAGE_REPOSITORY }}:${{ env.RELEASE }}
33
- ${{ env.IMAGE_REPOSITORY }}:stable
34
- ${{ env.IMAGE_REPOSITORY }}:latest
50
+ tags : ${{ steps.meta.outputs.tags }}
51
+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments