@@ -2,8 +2,6 @@ name: Docker Build and Publish Manager
22
33on :
44 push :
5- branches :
6- - ' main'
75 tags :
86 - ' v*'
97
@@ -12,47 +10,47 @@ jobs:
1210 runs-on : ubuntu-latest
1311 steps :
1412 - name : Set up QEMU
15- uses : docker/setup-qemu-action@v1
13+ uses : docker/setup-qemu-action@v3
1614
1715 - name : Set up Docker Buildx
18- uses : docker/setup-buildx-action@v1
16+ uses : docker/setup-buildx-action@v3
1917
2018 - name : Checkout
2119 uses : actions/checkout@v3
2220
21+ - name : Set lowercase repository name
22+ id : set_lowercase_repo
23+ run : |
24+ LOWERCASE_REPO=$(echo "${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')
25+ echo "::set-output name=lowercase_repo::${LOWERCASE_REPO}"
26+
2327 # manager docker
2428 - name : Extract metadata (tags, labels) for Docker
2529 id : meta
2630 uses : docker/metadata-action@v5
2731 with :
28- images : ${{ github.actor }}/ntask -manager
32+ images : ${{ steps.set_lowercase_repo.outputs.lowercase_repo }}-manager
2933
3034 - name : Login to DockerHub
31- uses : docker/login-action@v1
35+ uses : docker/login-action@v3
3236 with :
3337 username : ${{ github.actor }}
3438 password : ${{ secrets.DOCKERHUB_TOKEN }}
35- - name : Build and push docker
36- id : docker_build
37- uses : docker/build-push-action@v2
38- with :
39- context : .
40- file : ./manager/Dockerfile
41- platforms : linux/amd64
42- push : true
43- tags : ${{ steps.meta.outputs.tags }}
44- labels : ${{ steps.meta.outputs.labels }}
4539
4640 - name : Login to GitHub Container Registry
4741 run : echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
4842
49- - name : Build and push docker
50- id : docker_build_ghcr
43+ # Push
44+ - name : Build and push
45+ id : docker_build
5146 uses : docker/build-push-action@v5
5247 with :
5348 context : .
5449 file : ./manager/Dockerfile
55- platforms : linux/amd64
50+ platforms : linux/amd64,linux/arm64
5651 push : true
57- tags : ghcr.io/${{ github.actor }}/ntask-manager:latest, ghcr.io/${{ steps.meta.outputs.tags }}
58- labels : ${{ steps.meta.outputs.labels }}
52+ tags : |
53+ ${{ steps.meta.outputs.tags }}
54+ ghcr.io/${{ steps.set_lowercase_repo.outputs.lowercase_repo }}-manager:latest
55+ ghcr.io/${{ steps.meta.outputs.tags }}
56+ labels : ${{ steps.meta.outputs.labels }}
0 commit comments