@@ -11,68 +11,48 @@ jobs:
11
11
build-and-push :
12
12
runs-on : ubuntu-latest
13
13
steps :
14
- - name : Checkout repository
15
- uses : actions/checkout@v3
14
+ - name : Checkout Repository
15
+ uses : actions/checkout@v4
16
+
17
+ - name : Set up QEMU
18
+ uses : docker/setup-qemu-action@v3
16
19
17
20
- name : Set up Docker Buildx
18
- uses : docker/setup-buildx-action@v2
21
+ uses : docker/setup-buildx-action@v3
22
+ with :
23
+ driver-opts : image=moby/buildkit:latest
19
24
20
25
- name : Log in to Docker Hub
21
- uses : docker/login-action@v2
26
+ uses : docker/login-action@v3
22
27
with :
23
- username : ${{ secrets.DOCKER_USERNAME }}
28
+ username : ${{ github.repository_owner }}
24
29
password : ${{ secrets.DOCKER_PASSWORD }}
25
30
26
31
- name : Log in to the Container registry
27
- uses : docker/login-action@v2
32
+ uses : docker/login-action@v3
28
33
with :
29
34
registry : ghcr.io
30
35
username : ${{ github.actor }}
31
36
password : ${{ secrets.GITHUB_TOKEN }}
32
37
33
- - name : Extract version number
34
- id : get_version
35
- run : echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
36
- if : startsWith(github.ref, 'refs/tags/')
37
-
38
- - name : Cache Docker layers
39
- uses : actions/cache@v3
40
- with :
41
- path : /tmp/.buildx-cache
42
- key : ${{ runner.os }}-buildx-${{ github.sha }}
43
- restore-keys : |
44
- ${{ runner.os }}-buildx-
45
-
46
- - name : Build and push Docker image
47
- uses : docker/build-push-action@v5
48
- with :
49
- context : .
50
- push : true
51
- tags : |
52
- davidecavestro/gphotos-cdp:dev-main
53
- davidecavestro/gphotos-cdp:${{ github.sha }}
54
- ghcr.io/davidecavestro/gphotos-cdp:dev-main
55
- ghcr.io/davidecavestro/gphotos-cdp:${{ github.sha }}
56
- cache-from : type=local,src=/tmp/.buildx-cache
57
- cache-to : type=local,dest=/tmp/.buildx-cache
58
- if : github.ref == 'refs/heads/main'
59
-
60
- - name : Build and push tagged Docker image
38
+ - name : Build and push image
61
39
uses : docker/build-push-action@v5
62
40
with :
63
41
context : .
42
+ platforms : linux/amd64,linux/arm64
64
43
push : true
65
44
tags : |
66
- davidecavestro/gphotos-cdp:${{ env.VERSION }}
45
+ davidecavestro/gphotos-cdp:${{ github.ref_name }}
67
46
davidecavestro/gphotos-cdp:latest
68
- ghcr.io/davidecavestro/gphotos-cdp:${{ env.VERSION }}
47
+ ghcr.io/davidecavestro/gphotos-cdp:${{ github.ref_name }}
69
48
ghcr.io/davidecavestro/gphotos-cdp:latest
70
- if : startsWith(github.ref, 'refs/tags/')
49
+ cache-from : type=gha
50
+ cache-to : type=gha,mode=max
71
51
72
52
- name : Docker Hub Description
73
53
uses : peter-evans/dockerhub-description@v4
74
54
with :
75
- username : ${{ secrets.DOCKER_USERNAME }}
55
+ username : ${{ github.repository_owner }}
76
56
password : ${{ secrets.DOCKER_PASSWORD }}
77
57
repository : davidecavestro/gphotos-cdp
78
58
short-description : ${{ github.event.repository.description }}
104
84
tag_name : ${{ github.ref_name }}
105
85
release_name : v${{ github.ref_name }}
106
86
body : |
107
- This release provides the container image:
108
- `davidecavestro/gphotos-cdp:${{ github.ref_name }}`
87
+ Container images for this release:
88
+ - Docker Hub: `davidecavestro/gphotos-cdp:${{ github.ref_name }}`
89
+ - GitHub Container Registry: `ghcr.io/davidecavestro/gphotos-cdp:${{ github.ref_name }}`
109
90
${{ steps.changelog.outputs.changes }}
110
91
draft : false
111
92
prerelease : false
@@ -115,4 +96,13 @@ jobs:
115
96
with :
116
97
branch : main
117
98
commit_message : ' docs: update CHANGELOG.md for ${{ github.ref_name }} [skip ci]'
118
- file_pattern : CHANGELOG.md
99
+ file_pattern : CHANGELOG.md
100
+
101
+ - name : Docker Hub Description
102
+ uses : peter-evans/dockerhub-description@v4
103
+ with :
104
+ username : ${{ github.repository_owner }}
105
+ password : ${{ secrets.DOCKER_PASSWORD }}
106
+ repository : davidecavestro/usql
107
+ short-description : ${{ github.event.repository.description }}
108
+ enable-url-completion : true
0 commit comments