1- name : Build Docker image
1+ name : Build Docker image (release)
22
33on :
44 push :
55 tags :
66 - " *.*.*"
77
8+ env :
9+ REGISTRY : ghcr.io
10+ IMAGE_NAME : ${{ github.repository }}
11+
812jobs :
913 build_deploy :
10- name : Build and Deploy
14+ name : Build and Push
1115 runs-on : ubuntu-latest
1216 permissions :
1317 contents : read
1418 packages : write
1519 steps :
1620 - name : Checkout
17- uses : actions/checkout@v5
21+ uses : actions/checkout@v4
1822 with :
1923 submodules : recursive
2024
2125 - name : Docker meta
2226 id : meta
2327 uses : docker/metadata-action@v5
2428 with :
25- images : evoapicloud/evolution-api
26- tags : type=semver,pattern=v{{version}}
29+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
30+ tags : |
31+ type=semver,pattern={{version}}
32+ type=semver,pattern={{major}}.{{minor}}
2733
2834 - name : Set up QEMU
2935 uses : docker/setup-qemu-action@v3
@@ -34,17 +40,23 @@ jobs:
3440 - name : Login to GitHub Container Registry
3541 uses : docker/login-action@v3
3642 with :
37- username : ${{ secrets.DOCKER_USERNAME }}
38- password : ${{ secrets.DOCKER_PASSWORD }}
43+ registry : ${{ env.REGISTRY }}
44+ username : ${{ github.actor }}
45+ password : ${{ secrets.GITHUB_TOKEN }}
3946
4047 - name : Build and push
4148 id : docker_build
4249 uses : docker/build-push-action@v6
4350 with :
51+ context : .
4452 platforms : linux/amd64,linux/arm64
4553 push : true
4654 tags : ${{ steps.meta.outputs.tags }}
4755 labels : ${{ steps.meta.outputs.labels }}
56+ cache-from : type=gha
57+ cache-to : type=gha,mode=max
4858
49- - name : Image digest
50- run : echo ${{ steps.docker_build.outputs.digest }}
59+ - name : Summary
60+ env :
61+ DIGEST : ${{ steps.docker_build.outputs.digest }}
62+ run : echo "Image digest: $DIGEST"
0 commit comments