@@ -20,22 +20,49 @@ jobs:
20
20
submodules : ' recursive'
21
21
22
22
- name : Set up QEMU
23
- uses : docker/setup-qemu-action@v1
23
+ uses : docker/setup-qemu-action@v3
24
24
25
25
- name : Set up Docker Buildx
26
- uses : docker/setup-buildx-action@v1
26
+ uses : docker/setup-buildx-action@v3
27
27
28
28
- name : Login to GitHub Container Registry
29
- uses : docker/login-action@v1
29
+ uses : docker/login-action@v3
30
30
with :
31
31
registry : ${{ env.REGISTRY }}
32
32
username : ${{ github.repository_owner }}
33
33
password : ${{ secrets.GITHUB_TOKEN }}
34
34
35
+ - name : Build and export to Docker
36
+ uses : docker/build-push-action@v6
37
+ with :
38
+ load : true
39
+ context : ./
40
+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
41
+
42
+ - name : Test
43
+ run : |
44
+ docker run --rm ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:test
45
+
46
+ - name : Get next tag
47
+ id : tag
48
+ run : |
49
+ git fetch --all --tags
50
+ git tag -l
51
+ NEW_TAG=v$(date +'%Y.%m')
52
+ FOUND=$(git tag -l | grep $NEW_TAG | wc -l)
53
+ if [ $FOUND -eq 0 ]; then
54
+ echo "TAG=$NEW_TAG" >> $GITHUB_OUTPUT
55
+ else
56
+ echo "TAG=$NEW_TAG-$FOUND" >> $GITHUB_OUTPUT
57
+ fi
58
+
35
59
- name : Build and push
36
60
id : docker_build
37
- uses : docker/build-push-action@v2
61
+ uses : docker/build-push-action@v6
38
62
with :
63
+ platforms : linux/amd64,linux/arm64
39
64
push : true
40
65
context : ./
41
- tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
66
+ tags : |
67
+ ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
68
+ ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag.outputs.TAG }}
0 commit comments