Skip to content

Commit 91f1484

Browse files
jordi-midokuracasaroli
authored andcommitted
ci: use lowercase in docker images namespaces
1 parent cc73821 commit 91f1484

File tree

6 files changed

+64
-13
lines changed

6 files changed

+64
-13
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ on:
1010
default: latest
1111
required: false
1212
type: string
13+
package-namespace:
14+
description: The package namespace for docker images
15+
default: ${{ github.repository }}
16+
required: false
17+
type: string
1318
ref:
1419
type: string
1520
required: true
@@ -19,7 +24,7 @@ jobs:
1924
name: Agent (${{ matrix.name }}, ${{ matrix.platform }})
2025
runs-on: ${{ matrix.runner }}
2126
container:
22-
image: ghcr.io/${{ github.repository }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
27+
image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
2328
credentials:
2429
username: ${{ github.actor }}
2530
password: ${{ github.token }}
@@ -82,7 +87,7 @@ jobs:
8287
name: SDK (${{ matrix.name }}, ${{ matrix.platform }})
8388
runs-on: ${{ matrix.runner }}
8489
container:
85-
image: ghcr.io/${{ github.repository }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
90+
image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
8691
credentials:
8792
username: ${{ github.actor }}
8893
password: ${{ github.token }}
@@ -170,7 +175,7 @@ jobs:
170175
name: Static Code Analysis
171176
runs-on: ubuntu-24.04
172177
container:
173-
image: ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ inputs.builder-tag }}
178+
image: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ inputs.builder-tag }}
174179
options: --user 1001:127
175180
timeout-minutes: 8 # the worst case is 3 minutes
176181

.github/workflows/builder.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,20 @@ on:
1212
type: string
1313
required: false
1414
default: main
15+
package-namespace:
16+
description: The package namespace for docker images
17+
required: true
18+
type: string
1519
workflow_call:
1620
inputs:
1721
ref:
1822
type: string
1923
required: false
24+
package-namespace:
25+
description: The package namespace for docker images
26+
default: ${{ github.repository }}
27+
required: false
28+
type: string
2029
outputs:
2130
builder-tag:
2231
description: tag
@@ -89,7 +98,7 @@ jobs:
8998
context: .devcontainer/raspi
9099
file: .devcontainer/raspi/Dockerfile
91100
push: true
92-
tags: ghcr.io/${{ github.repository }}/builder-raspios-bookworm:${{ needs.builder-necessary.outputs.builder-tag }}
101+
tags: ghcr.io/${{ inputs.package-namespace }}/builder-raspios-bookworm:${{ needs.builder-necessary.outputs.builder-tag }}
93102

94103
build-push-ubuntu:
95104
name: Build and push ubuntu noble (${{ matrix.platform }})
@@ -127,7 +136,7 @@ jobs:
127136
file: .devcontainer/ubuntu/Dockerfile
128137
push: true
129138
provenance: false
130-
tags: ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-${{ matrix.platform }}
139+
tags: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-${{ matrix.platform }}
131140

132141
manifest-ubuntu:
133142
if: ${{ needs.builder-necessary.outputs.build == 'true' }}
@@ -148,7 +157,7 @@ jobs:
148157
- name: Create and push multiarch manifests
149158
run: |
150159
docker manifest create \
151-
ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }} \
152-
ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-amd64 \
153-
ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-arm64
154-
docker manifest push ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}
160+
ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }} \
161+
ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-amd64 \
162+
ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}-arm64
163+
docker manifest push ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ needs.builder-necessary.outputs.builder-tag }}

.github/workflows/check.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ on:
1313
ref:
1414
type: string
1515
required: true
16+
package-namespace:
17+
description: The package namespace for docker images
18+
default: ${{ github.repository }}
19+
required: false
20+
type: string
1621

1722
jobs:
1823
check:
1924
name: Formatting
2025
runs-on: ubuntu-24.04
2126
container:
22-
image: ghcr.io/${{ github.repository }}/builder-ubuntu-noble:${{ inputs.builder-tag}}
27+
image: ghcr.io/${{ inputs.package-namespace }}/builder-ubuntu-noble:${{ inputs.builder-tag}}
2328
options: --user 1001:127
2429
timeout-minutes: 3 # the worst case is < 1 minute
2530
steps:

.github/workflows/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ on:
2121
type: string
2222
required: false
2323
default: main
24+
package-namespace:
25+
description: The package namespace for docker images
26+
required: true
27+
type: string
2428

2529
schedule:
2630
- cron: 0 0 * * 1-5
@@ -34,8 +38,11 @@ jobs:
3438
infos:
3539
name: Infos
3640
runs-on: ubuntu-24.04
41+
outputs:
42+
package-namespace: ${{ steps.infos.outputs.namespace }}
3743
steps:
3844
- name: Some infos
45+
id: infos
3946
run: |
4047
echo github.ref is ${{ github.ref }}
4148
echo github.head_ref is ${{ github.head_ref }}
@@ -44,45 +51,58 @@ jobs:
4451
echo github.event.pull_request.user.login is ${{ github.event.pull_request.user.login }}
4552
echo github.event.action is ${{ github.event.action }}
4653
echo github.event.repository_owner is ${{ github.repository_owner }}
54+
NAMESPACE=${{ github.repository || github.event.repository }}
55+
NAMESPACE_LC=${NAMESPACE@L}
56+
echo "namespace=${NAMESPACE_LC}" >> $GITHUB_OUTPUT
57+
echo namespace is ${NAMESPACE_LC}
4758
4859
builder:
4960
name: Builder
61+
needs:
62+
- infos
5063
uses: ./.github/workflows/builder.yml
5164
secrets: inherit
5265
with:
5366
ref: ${{ inputs.ref || github.sha }}
67+
package-namespace: ${{ needs.infos.outputs.package-namespace }}
5468

5569
checks:
5670
name: Checks
5771
needs:
5872
- builder
73+
- infos
5974
uses: ./.github/workflows/check.yml
6075
secrets: inherit
6176
with:
6277
builder-tag: ${{ needs.builder.outputs.builder-tag }}
6378
ref: ${{ inputs.ref || github.sha }}
79+
package-namespace: ${{ needs.infos.outputs.package-namespace }}
6480

6581
test-modules:
6682
name: Test-modules
6783
needs:
6884
- checks
6985
- builder
86+
- infos
7087
uses: ./.github/workflows/test-modules.yml
7188
secrets: inherit
7289
with:
7390
builder-tag: ${{ needs.builder.outputs.builder-tag }}
7491
ref: ${{ inputs.ref || github.sha }}
92+
package-namespace: ${{ needs.infos.outputs.package-namespace }}
7593

7694
build:
7795
name: Build
7896
needs:
7997
- checks
8098
- builder
99+
- infos
81100
uses: ./.github/workflows/build.yml
82101
secrets: inherit
83102
with:
84103
builder-tag: ${{ needs.builder.outputs.builder-tag }}
85104
ref: ${{ inputs.ref || github.sha }}
105+
package-namespace: ${{ needs.infos.outputs.package-namespace }}
86106

87107
tests:
88108
name: Tests
@@ -91,11 +111,13 @@ jobs:
91111
- build
92112
- test-modules
93113
- builder
114+
- infos
94115
uses: ./.github/workflows/test.yml
95116
secrets: inherit
96117
with:
97118
builder-tag: ${{ needs.builder.outputs.builder-tag }}
98119
ref: ${{ inputs.ref || github.sha }}
120+
package-namespace: ${{ needs.infos.outputs.package-namespace }}
99121

100122
checkpoint-tests-success:
101123
if: ${{ always() }}

.github/workflows/test-modules.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,18 @@ on:
2626
default: latest
2727
required: false
2828
type: string
29+
package-namespace:
30+
description: The package namespace for docker images
31+
default: ${{ github.repository }}
32+
required: false
33+
type: string
2934

3035
jobs:
3136
build-modules:
3237
name: Build modules (${{ matrix.name }}, ${{ matrix.platform }})
3338
runs-on: ${{ matrix.runner }}
3439
container:
35-
image: ghcr.io/${{ github.repository }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
40+
image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
3641
credentials:
3742
username: ${{ github.actor }}
3843
password: ${{ github.token }}

.github/workflows/test.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,24 @@ on:
77
inputs:
88
builder-tag:
99
description: The builder tag to be used
10-
default: ghcr.io/${{ github.repository }}/builder-raspios-bookworm
10+
default: ghcr.io/${{ inputs.package-namespace }}/builder-raspios-bookworm
1111
required: false
1212
type: string
1313
ref:
1414
type: string
1515
required: true
16+
package-namespace:
17+
description: The package namespace for docker images
18+
default: ${{ github.repository }}
19+
required: false
20+
type: string
1621

1722
jobs:
1823
test:
1924
name: Unit tests (${{ matrix.name }}, ${{ matrix.platform }})
2025
runs-on: ${{ matrix.runner }}
2126
container:
22-
image: ghcr.io/${{ github.repository }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
27+
image: ghcr.io/${{ inputs.package-namespace }}/builder-${{ matrix.name }}:${{ inputs.builder-tag }}
2328
credentials:
2429
username: ${{ github.actor }}
2530
password: ${{ github.token }}

0 commit comments

Comments
 (0)