Skip to content

Commit

Permalink
CI: Add target/arch tags (no suffix) for snapshot images
Browse files Browse the repository at this point in the history
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
  • Loading branch information
jefferyto authored and aparcar committed Jun 29, 2023
1 parent ecd0a15 commit 01e5cfc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ jobs:
${{ matrix.target }}-${{ needs.generate_matrix.outputs.ref }}
${{ matrix.target }}-${{ needs.generate_matrix.outputs.version }}
${{ matrix.target }}-master,enable=${{ needs.generate_matrix.outputs.ref == 'main' }}
${{ matrix.target }},enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' }}
latest,enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' && matrix.target == 'x86/64'}}
- name: Build and push
Expand Down Expand Up @@ -277,6 +278,19 @@ jobs:
suffix=-master
tags: ${{ matrix.tags }}

- name: Docker meta (target and arch)
if: needs.generate_matrix.outputs.version == 'SNAPSHOT'
id: meta_target_arch
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/openwrt/sdk
docker.io/openwrt/sdk
quay.io/openwrt/sdk
flavor: |
latest=false
tags: ${{ matrix.tags }}

- name: Build and push
uses: docker/build-push-action@v3
with:
Expand All @@ -285,6 +299,7 @@ jobs:
${{ steps.meta_ref.outputs.tags }}
${{ steps.meta_version.outputs.tags }}
${{ steps.meta_master.outputs.tags }}
${{ steps.meta_target_arch.outputs.tags }}
build-args: |
DOWNLOAD_FILE=sdk-.*.Linux-x86_64.tar.xz
VERSION_PATH=${{ needs.generate_matrix.outputs.version_path }}
Expand Down Expand Up @@ -344,9 +359,11 @@ jobs:
${{ matrix.target }}-${{ needs.generate_matrix.outputs.ref }}
${{ matrix.target }}-${{ needs.generate_matrix.outputs.version }}
${{ matrix.target }}-master,enable=${{ needs.generate_matrix.outputs.ref == 'main' }}
${{ matrix.target }},enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' }}
${{ matrix.arch }}-${{ needs.generate_matrix.outputs.ref }}
${{ matrix.arch }}-${{ needs.generate_matrix.outputs.version }}
${{ matrix.arch }}-master,enable=${{ needs.generate_matrix.outputs.ref == 'main' }}
${{ matrix.arch }},enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' }}
latest,enable=${{ needs.generate_matrix.outputs.version == 'SNAPSHOT' && matrix.target == 'x86/64'}}
- name: Generate build args
Expand Down

0 comments on commit 01e5cfc

Please sign in to comment.