Skip to content

Commit 4b035e2

Browse files
authored
ci(publish): add image and username inputs (#7)
potentially in the future we could publish to other registries
1 parent acf9dcb commit 4b035e2

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

.github/workflows/publish-2.7.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,10 @@ jobs:
2929
2.7-slim
3030
2.7.18-slim
3131
with:
32+
image: coatldev/python
3233
version: ${{ matrix.image.version }}
3334
variant: ${{ matrix.image.variant }}
3435
tags: ${{ matrix.image.tags }}
36+
username: ${{ vars.DOCKERHUB_USERNAME }}
3537
secrets:
3638
password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/publish-3.12.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,20 @@ jobs:
4848
- version: '3.12'
4949
variant: bookworm
5050
tags: |
51-
type=raw,value=${{ needs.tagger.outputs.major }}
52-
type=raw,value=${{ needs.tagger.outputs.major_minor }}
53-
type=raw,value=${{ needs.tagger.outputs.version }}
51+
${{ needs.tagger.outputs.major }}
52+
${{ needs.tagger.outputs.major_minor }}
53+
${{ needs.tagger.outputs.version }}
5454
- version: '3.12'
5555
variant: slim-bookworm
5656
tags: |
57-
type=raw,value=${{ needs.tagger.outputs.major }}-slim
58-
type=raw,value=${{ needs.tagger.outputs.major_minor }}-slim
59-
type=raw,value=${{ needs.tagger.outputs.version }}-slim
57+
${{ needs.tagger.outputs.major }}-slim
58+
${{ needs.tagger.outputs.major_minor }}-slim
59+
${{ needs.tagger.outputs.version }}-slim
6060
with:
61+
image: coatldev/python
6162
version: ${{ matrix.image.version }}
6263
variant: ${{ matrix.image.variant }}
6364
tags: ${{ matrix.image.tags }}
65+
username: ${{ vars.DOCKERHUB_USERNAME }}
6466
secrets:
6567
password: ${{ secrets.DOCKERHUB_TOKEN }}

.github/workflows/publish.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
on:
22
workflow_call:
33
inputs:
4+
image:
5+
description: >-
6+
Docker image to use as base name for tags.
7+
required: true
8+
type: string
49
version:
510
description: >-
611
Python version to release.
@@ -16,18 +21,25 @@ on:
1621
List of tags as key-value pair attributes.
1722
required: false
1823
type: string
24+
username:
25+
description: >-
26+
Username for authenticating to the Docker registry.
27+
required: true
28+
type: string
1929
secrets:
2030
password:
31+
description: >-
32+
Password or personal access token for authenticating the Docker registry.
2133
required: true
2234

2335
jobs:
2436
publish:
2537
uses: coatl-dev/workflows/.github/workflows/docker-build-push-multi-platform.yml@v4
2638
with:
27-
registry-image: coatldev/python
39+
registry-image: ${{ inputs.image }}
2840
metadata-tags: |
2941
${{ inputs.tags }}
30-
registry-username: ${{ vars.DOCKERHUB_USERNAME }}
42+
registry-username: ${{ inputs.username }}
3143
build-file: ${{ inputs.version }}/${{ inputs.variant }}/Dockerfile
3244
build-cache-key: ${{ inputs.version }}-${{ inputs.variant }}
3345
build-digest-key: ${{ inputs.version }}-${{ inputs.variant }}

0 commit comments

Comments
 (0)