Skip to content

Commit 73af506

Browse files
Eneman DonatienDonatien26
authored andcommitted
[BUG] ci image is not published
1 parent 124e985 commit 73af506

File tree

3 files changed

+50
-94
lines changed

3 files changed

+50
-94
lines changed

.github/workflows/ci-docker.yaml

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Docker CI
22

33
on:
4+
release:
5+
types: [created, published]
46
push:
57
branches:
68
- "**"
@@ -23,18 +25,51 @@ jobs:
2325
dockerfile: Dockerfile
2426

2527
build-and-publish-docker:
26-
needs: lint-docker
27-
uses: ./.github/workflows/publish.yaml
28-
permissions:
29-
id-token: write
30-
contents: read
31-
with:
32-
ref: ${{ github.ref }}
33-
image-tag: |
34-
type=schedule
35-
type=ref,event=branch
36-
type=ref,event=pr
37-
type=ref,event=tag
38-
secrets:
39-
registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
40-
registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
28+
runs-on: ubuntu-latest
29+
needs:
30+
- lint-docker
31+
steps:
32+
- name: Checkout code
33+
uses: actions/checkout@v4
34+
with:
35+
fetch-depth: 0 # Ensure full history
36+
37+
- name: Docker meta
38+
id: docker_meta
39+
uses: docker/metadata-action@v5
40+
with:
41+
images: inseefrlab/s3-operator # list of Docker images to use as base name for tags
42+
tags: |
43+
type=ref,event=branch
44+
type=ref,event=pr
45+
type=semver,pattern=v{{version}}
46+
type=semver,pattern=v{{major}}.{{minor}}
47+
type=semver,pattern=v{{major}}
48+
49+
- name: Set up QEMU
50+
uses: docker/setup-qemu-action@v3
51+
52+
- name: Set up Docker Buildx
53+
uses: docker/setup-buildx-action@v3
54+
55+
- name: Login to DockerHub
56+
if: github.event_name != 'pull_request'
57+
uses: docker/login-action@v3
58+
with:
59+
username: ${{ secrets.registry_username }}
60+
password: ${{ secrets.registry_password }}
61+
62+
- name: Build and push
63+
id: build_push
64+
uses: docker/build-push-action@v6
65+
with:
66+
context: .
67+
file: ./Dockerfile
68+
push: ${{ github.event_name != 'pull_request' }}
69+
tags: |
70+
${{ steps.docker_meta.outputs.tags }}
71+
labels: ${{ steps.docker_meta.outputs.labels }}
72+
platforms: linux/amd64,linux/arm64
73+
74+
- name: Image digest
75+
run: echo ${{ steps.build_push.outputs.digest }}

.github/workflows/publish.yaml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,24 +42,6 @@ jobs:
4242
git checkout -b $NEW_BRANCH
4343
git push origin $NEW_BRANCH
4444
45-
build-and-publish-docker:
46-
needs:
47-
- create-release-branch
48-
uses: ./.github/workflows/publish.yaml
49-
permissions:
50-
id-token: write
51-
contents: read
52-
with:
53-
ref: ${{ github.ref }}
54-
image-tag: |
55-
type=semver,pattern={{raw}},value=${{ github.event.inputs.version }}
56-
type=semver,pattern=v{{major}}.{{minor}},value=${{ github.event.inputs.version }}
57-
type=semver,pattern=v{{major}},value=${{ github.event.inputs.version }}
58-
type=raw,value=latest,enable=${{ !github.event.inputs.pre_release }}
59-
secrets:
60-
registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
61-
registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
62-
6345
release:
6446
name: Make release
6547
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)