|
51 | 51 | matrix: |
52 | 52 | arch: ["amd64", "arm64", "arm/v7", "arm/v6"] |
53 | 53 | base_image: ["debian","alpine"] |
54 | | - outputs: |
55 | | - base-tags: ${{ steps.determine-version.outputs.BASE_TAGS }} |
56 | 54 |
|
57 | 55 | steps: |
58 | 56 | - name: Initialize QEMU binfmt support |
|
90 | 88 | NORMALIZED_ARCH="${MATRIX_ARCH//\/}" |
91 | 89 | echo "NORMALIZED_ARCH=${NORMALIZED_ARCH}" | tee -a "${GITHUB_ENV}" |
92 | 90 |
|
93 | | - # Determine Base Tags and Source Version |
94 | | - - name: Determine Base Tags and Source Version |
95 | | - id: determine-version |
96 | | - env: |
97 | | - REF_TYPE: ${{ github.ref_type }} |
| 91 | + # Determine Source Version |
| 92 | + - name: Determine Source Version |
98 | 93 | run: | |
99 | | - # Check which main tag we are going to build determined by ref_type |
100 | | - if [[ "${REF_TYPE}" == "tag" ]]; then |
101 | | - echo "BASE_TAGS=latest,${GITHUB_REF#refs/*/}" | tee -a "${GITHUB_OUTPUT}" |
102 | | - elif [[ "${REF_TYPE}" == "branch" ]]; then |
103 | | - echo "BASE_TAGS=testing" | tee -a "${GITHUB_OUTPUT}" |
104 | | - fi |
105 | | -
|
106 | 94 | # Get the Source Version for this release |
107 | 95 | GIT_EXACT_TAG="$(git describe --tags --abbrev=0 --exact-match 2>/dev/null || true)" |
108 | 96 | if [[ -n "${GIT_EXACT_TAG}" ]]; then |
|
111 | 99 | GIT_LAST_TAG="$(git describe --tags --abbrev=0)" |
112 | 100 | echo "SOURCE_VERSION=${GIT_LAST_TAG}-${SOURCE_COMMIT:0:8}" | tee -a "${GITHUB_ENV}" |
113 | 101 | fi |
114 | | - # End Determine Base Tags |
115 | 102 |
|
116 | 103 | # Login to Docker Hub |
117 | 104 | - name: Login to Docker Hub |
@@ -260,15 +247,10 @@ jobs: |
260 | 247 | name: Merge manifests |
261 | 248 | runs-on: ubuntu-latest |
262 | 249 | needs: docker-build |
263 | | - |
264 | | - env: |
265 | | - BASE_TAGS: ${{ needs.docker-build.outputs.base-tags }} |
266 | | - |
267 | 250 | permissions: |
268 | 251 | packages: write # Needed to upload packages and artifacts |
269 | 252 | attestations: write # Needed to generate an artifact attestation for a build |
270 | 253 | id-token: write # Needed to mint the OIDC token necessary to request a Sigstore signing certificate |
271 | | - |
272 | 254 | strategy: |
273 | 255 | matrix: |
274 | 256 | base_image: ["debian","alpine"] |
@@ -328,6 +310,18 @@ jobs: |
328 | 310 | run: | |
329 | 311 | echo "CONTAINER_REGISTRIES=${CONTAINER_REGISTRIES:+${CONTAINER_REGISTRIES},}${QUAY_REPO}" | tee -a "${GITHUB_ENV}" |
330 | 312 |
|
| 313 | + # Determine Base Tags |
| 314 | + - name: Determine Base Tags |
| 315 | + env: |
| 316 | + REF_TYPE: ${{ github.ref_type }} |
| 317 | + run: | |
| 318 | + # Check which main tag we are going to build determined by ref_type |
| 319 | + if [[ "${REF_TYPE}" == "tag" ]]; then |
| 320 | + echo "BASE_TAGS=latest,${GITHUB_REF#refs/*/}" | tee -a "${GITHUB_ENV}" |
| 321 | + elif [[ "${REF_TYPE}" == "branch" ]]; then |
| 322 | + echo "BASE_TAGS=testing" | tee -a "${GITHUB_ENV}" |
| 323 | + fi |
| 324 | +
|
331 | 325 | - name: Create manifest list, push it and extract digest SHA |
332 | 326 | working-directory: ${{ runner.temp }}/digests |
333 | 327 | env: |
|
0 commit comments