Skip to content

Commit fe27692

Browse files
authored
Merge pull request #1112 from GitGuardian/severine/produce-docker-arm-images
feat: push linux/arm64 docker images
2 parents ee19691 + 7263a0e commit fe27692

File tree

3 files changed

+99
-48
lines changed

3 files changed

+99
-48
lines changed

.github/workflows/ci.yml

Lines changed: 23 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -164,41 +164,39 @@ jobs:
164164
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
165165
GITGUARDIAN_API_URL: ${{ secrets.GITGUARDIAN_API_URL }}
166166

167-
dockerhub-unstable:
168-
name: Push Docker image to Docker Hub
167+
push_docker_images-unstable:
168+
name: Push Docker image to Docker Hub and GitHub Packages
169169
runs-on: ubuntu-22.04
170170
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
171171
needs:
172172
- lint
173173
- build
174174
- test_github_secret_scan_action
175175
steps:
176-
- name: Checkout
177-
uses: actions/checkout@v4
178-
- name: Build and push
179-
uses: docker/build-push-action@v1
176+
- name: Login to Docker Hub
177+
uses: docker/login-action@v3
180178
with:
181179
username: ${{ secrets.DOCKER_USERNAME }}
182180
password: ${{ secrets.DOCKER_PASSWORD }}
183-
repository: gitguardian/ggshield
184-
tags: unstable
185181

186-
github_packages-unstable:
187-
name: Push Docker image to GitHub Packages
188-
runs-on: ubuntu-22.04
189-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
190-
needs:
191-
- lint
192-
- build
193-
- test_github_secret_scan_action
194-
steps:
195-
- name: Check out the repo
196-
uses: actions/checkout@v4
197-
- name: Push to GitHub Packages
198-
uses: docker/build-push-action@v1
182+
- name: Login to GitHub Container Registry
183+
uses: docker/login-action@v3
199184
with:
200-
username: ${{ github.actor }}
185+
registry: ghcr.io
186+
username: ${{ github.repository_owner }}
201187
password: ${{ secrets.GITHUB_TOKEN }}
202-
registry: docker.pkg.github.com
203-
repository: gitguardian/ggshield/ggshield
204-
tags: unstable
188+
189+
- name: Set up QEMU
190+
uses: docker/setup-qemu-action@v3
191+
192+
- name: Set up Docker Buildx
193+
uses: docker/setup-buildx-action@v3
194+
195+
- name: Build and push
196+
uses: docker/build-push-action@v6
197+
with:
198+
platforms: linux/amd64,linux/arm64
199+
push: true
200+
tags: |
201+
gitguardian/ggshield:unstable
202+
ghcr.io/gitguardian/ggshield/ggshield:unstable

.github/workflows/tag.yml

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,38 +92,49 @@ jobs:
9292
with:
9393
version: ${{ needs.release.outputs.tag }}
9494

95-
push_to_docker_hub:
96-
name: Push Docker image to Docker Hub
95+
push_docker_images:
96+
name: Push Docker image to Docker Hub and GitHub Packages
9797
runs-on: ubuntu-22.04
9898
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
9999
steps:
100-
- name: Checkout
101-
uses: actions/checkout@v4
102-
- name: Build and push
103-
uses: docker/build-push-action@v1
100+
- name: Docker meta
101+
id: meta
102+
uses: docker/metadata-action@v5
103+
with:
104+
images: |
105+
gitguardian/ggshield
106+
ghcr.io/gitguardian/ggshield/ggshield
107+
tags: |
108+
type=ref,event=tag
109+
110+
- name: Login to Docker Hub
111+
uses: docker/login-action@v3
104112
with:
105113
username: ${{ secrets.DOCKER_USERNAME }}
106114
password: ${{ secrets.DOCKER_PASSWORD }}
107-
repository: gitguardian/ggshield
108-
tag_with_ref: true
109-
tags: latest
110115

111-
push_to_github_packages:
112-
name: Push Docker image to GitHub Packages
113-
runs-on: ubuntu-22.04
114-
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
115-
steps:
116-
- name: Check out the repo
117-
uses: actions/checkout@v4
118-
- name: Push to GitHub Packages
119-
uses: docker/build-push-action@v1
116+
- name: Login to GitHub Container Registry
117+
uses: docker/login-action@v3
120118
with:
121-
username: ${{ github.actor }}
119+
registry: ghcr.io
120+
username: ${{ github.repository_owner }}
122121
password: ${{ secrets.GITHUB_TOKEN }}
123-
registry: docker.pkg.github.com
124-
repository: gitguardian/ggshield/ggshield
125-
tag_with_ref: true
126-
tags: latest
122+
123+
- name: Set up QEMU
124+
uses: docker/setup-qemu-action@v3
125+
126+
- name: Set up Docker Buildx
127+
uses: docker/setup-buildx-action@v3
128+
129+
- name: Build and push
130+
uses: docker/build-push-action@v6
131+
with:
132+
platforms: linux/amd64,linux/arm64
133+
push: true
134+
tags: |
135+
${{ steps.meta.outputs.tags }}
136+
gitguardian/ggshield:latest
137+
ghcr.io/gitguardian/ggshield/ggshield:latest
127138
128139
push_to_cloudsmith:
129140
needs: build_release_assets
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
<!--
9+
### Removed
10+
11+
- A bullet item for the Removed category.
12+
13+
-->
14+
15+
### Added
16+
17+
- ggshield docker image is now multi-platform for both linux/amd64 and linux/arm64 (#952).
18+
19+
<!--
20+
### Changed
21+
22+
- A bullet item for the Changed category.
23+
24+
-->
25+
<!--
26+
### Deprecated
27+
28+
- A bullet item for the Deprecated category.
29+
30+
-->
31+
<!--
32+
### Fixed
33+
34+
- A bullet item for the Fixed category.
35+
36+
-->
37+
<!--
38+
### Security
39+
40+
- A bullet item for the Security category.
41+
42+
-->

0 commit comments

Comments
 (0)