Skip to content

Commit 5e1bd76

Browse files
Eneman DonatienEneman Donatien
authored andcommitted
[BUG] ci image is not published
1 parent e1af0e3 commit 5e1bd76

File tree

3 files changed

+25
-26
lines changed

3 files changed

+25
-26
lines changed

.github/workflows/ci-docker.yaml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,19 @@ on:
55
branches:
66
- "**"
77
paths-ignore:
8-
- 'docs/**'
8+
- "docs/**"
99
tags:
1010
- "**"
1111
pull_request:
1212
paths-ignore:
13-
- 'docs/**'
14-
15-
jobs:
13+
- "docs/**"
1614

15+
jobs:
1716
lint-docker:
1817
runs-on: ubuntu-latest
1918
steps:
2019
- name: Checkout code
2120
uses: actions/checkout@v4
22-
23-
2421
- uses: hadolint/[email protected]
2522
with:
2623
dockerfile: Dockerfile
@@ -33,7 +30,11 @@ jobs:
3330
contents: read
3431
with:
3532
ref: ${{ github.ref }}
36-
image-tag: ${{ github.ref }}
33+
image-tag: |
34+
type=schedule
35+
type=ref,event=branch
36+
type=ref,event=pr
37+
type=ref,event=tag
3738
secrets:
3839
registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
39-
registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
registry_password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/publish.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
image-tag:
1111
required: false
1212
type: string
13-
secrets:
13+
secrets:
1414
registry_username:
1515
required: true
1616
registry_password:
@@ -23,8 +23,8 @@ jobs:
2323
- name: Checkout code
2424
uses: actions/checkout@v4
2525
with:
26-
fetch-depth: 0 # Ensure full history
27-
ref: ${{ github.event.inputs.source_ref }}
26+
fetch-depth: 0 # Ensure full history
27+
ref: ${{ github.event.inputs.source_ref }}
2828

2929
- name: Docker meta
3030
id: docker_meta
@@ -53,7 +53,7 @@ jobs:
5353
file: ./Dockerfile
5454
push: ${{ github.event_name != 'pull_request' }}
5555
tags: |
56-
inseefrlab/s3-operator:${{ github.event.inputs.image-tag }}
56+
${{ steps.docker_meta.outputs.tags }}
5757
labels: ${{ steps.docker_meta.outputs.labels }}
5858
platforms: linux/amd64,linux/arm64
5959

.github/workflows/release.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,19 @@ on:
1515
default: false
1616
type: boolean
1717

18-
1918
name: Make release
2019

2120
jobs:
22-
2321
create-release-branch:
2422
runs-on: ubuntu-latest
2523
permissions:
26-
contents: write # Allows pushing branches
24+
contents: write # Allows pushing branches
2725
steps:
2826
- name: Checkout repository
2927
uses: actions/checkout@v4
3028
with:
31-
fetch-depth: 0 # Ensure full history
32-
ref: ${{ github.event.inputs.source_ref }}
29+
fetch-depth: 0 # Ensure full history
30+
ref: ${{ github.event.inputs.source_ref }}
3331

3432
- name: Configure Git
3533
run: |
@@ -44,19 +42,20 @@ jobs:
4442
git checkout -b $NEW_BRANCH
4543
git push origin $NEW_BRANCH
4644
47-
48-
49-
5045
build-and-publish-docker:
51-
needs:
46+
needs:
5247
- create-release-branch
5348
uses: ./.github/workflows/publish.yaml
5449
permissions:
5550
id-token: write
5651
contents: read
5752
with:
5853
ref: ${{ github.ref }}
59-
image-tag: ${{ github.event.inputs.version }}
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 }}
6059
secrets:
6160
registry_username: ${{ secrets.DOCKERHUB_USERNAME }}
6261
registry_password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -67,18 +66,17 @@ jobs:
6766
needs:
6867
- create-release-branch
6968
steps:
70-
7169
- name: Checkout code
7270
uses: actions/checkout@v4
73-
71+
7472
- name: Create Release
7573
id: create_release
76-
uses: softprops/action-gh-release@v2
74+
uses: softprops/action-gh-release@v2
7775
with:
7876
tag_name: ${{ github.event.inputs.version }}
7977
name: Release ${{ github.event.inputs.version }}
8078
draft: false
8179
prerelease: ${{ github.event.inputs.pre_release }}
8280
token: ${{ secrets.GITHUB_TOKEN }}
8381
generate_release_notes: true
84-
append_body: true
82+
append_body: true

0 commit comments

Comments
 (0)