From afaea49ba34320b03a3c42d40bcf546dd0bd9d15 Mon Sep 17 00:00:00 2001 From: benlee0423 Date: Sat, 2 Nov 2024 22:49:11 -0700 Subject: [PATCH] add manifest and comment on image tag name --- .../build-and-push/action.yaml | 14 +++++++------- .../build-and-test/action.yaml | 2 +- .github/workflows/docker_image_main_branch.yml | 18 +++++++++++++++++- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/action_templates/build-and-push/action.yaml b/.github/action_templates/build-and-push/action.yaml index 104866c..22cd6cf 100644 --- a/.github/action_templates/build-and-push/action.yaml +++ b/.github/action_templates/build-and-push/action.yaml @@ -25,18 +25,18 @@ runs: shell: bash run: | echo "TAG_NAME=latest" >> "$GITHUB_ENV" - if: startsWith(github.ref, 'refs/heads/main') - - name: Set env vars for other branch - shell: bash - run: | - echo "TAG_NAME=${GITHUB_REF##*/}" >> "$GITHUB_ENV" - if: ${{ !startsWith(github.ref, 'refs/heads/main') }} + # if: startsWith(github.ref, 'refs/heads/main') + #- name: Set env vars for other branch + # shell: bash + # run: | + # echo "TAG_NAME=${GITHUB_REF##*/}" >> "$GITHUB_ENV" + # if: ${{ !startsWith(github.ref, 'refs/heads/main') }} - name: Attach platform to tag shell: bash run: | echo "TAG_NAME=${{env.TAG_NAME}}-${{inputs.platform}}" >> "$GITHUB_ENV" - if: "${{ inputs.platform != 'ARM64' }}" + #if: "${{ inputs.platform != 'ARM64' }}" - name: Login to Docker Hub shell: bash diff --git a/.github/action_templates/build-and-test/action.yaml b/.github/action_templates/build-and-test/action.yaml index 28d7865..8ce85bf 100644 --- a/.github/action_templates/build-and-test/action.yaml +++ b/.github/action_templates/build-and-test/action.yaml @@ -35,7 +35,7 @@ runs: shell: bash run: | echo "TAG_NAME=${{env.TAG_NAME}}-${{inputs.platform}}" >> "$GITHUB_ENV" - if: "${{ inputs.platform != 'ARM64' }}" + #if: "${{ inputs.platform != 'ARM64' }}" - name: Create Cache and Builder for Buildx shell: bash run: | diff --git a/.github/workflows/docker_image_main_branch.yml b/.github/workflows/docker_image_main_branch.yml index 0d6837a..4a29a93 100644 --- a/.github/workflows/docker_image_main_branch.yml +++ b/.github/workflows/docker_image_main_branch.yml @@ -49,7 +49,7 @@ jobs: runs-on: ${{ matrix.runner}} strategy: matrix: - runner: [ARM64, x86] + runner: [arm64, x86] steps: - name: deploy uses: actions/checkout@v2 @@ -81,6 +81,22 @@ jobs: - id: step1 run: echo "result=success" >> "$GITHUB_OUTPUT" + create-manifest: + needs: check_result + runs-on: ARM64 + steps: + - name: Login to DockerHub + uses: docker/login-action@v3 + with: + username: awiciroh + password: ${{ secrets.DOCKER_AUTH_TOKEN }} + - name: Create and push manifest + run: | + docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/ciroh-ngen-image:latest \ + awiciroh/ciroh-ngen-image:latest-arm64 \ + awiciroh/ciroh-ngen-image:latest-x86 + docker manifest push awiciroh/ciroh-ngen-image:latest + slack: runs-on: ARM64 if: startsWith(github.event.pull_request.head.repo.full_name, 'CIROH-UA') ||