From a1df5ae9b7da2e78047ed032944fc1a77b046383 Mon Sep 17 00:00:00 2001 From: Iryna Shustava Date: Mon, 25 Jul 2022 16:43:24 -0600 Subject: [PATCH] build: add a build job to build and push UBI images to DockerHub (#13808) --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0320a7bb12..fc2506abf8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -254,8 +254,8 @@ jobs: docker.io/hashicorppreview/${{ env.repo }}:${{ env.dev_tag }}-${{ github.sha }} smoke_test: .github/scripts/verify_docker.sh v${{ env.version }} - build-docker-redhat: - name: Docker Build UBI Image for RedHat + build-docker-ubi-redhat: + name: Docker Build UBI Image for RedHat Registry needs: - get-product-version - build @@ -274,6 +274,39 @@ jobs: redhat_tag: scan.connect.redhat.com/ospid-60f9fdbec3a80eac643abedf/${{env.repo}}:${{env.version}}-ubi smoke_test: .github/scripts/verify_docker.sh v${{ env.version }} + build-docker-ubi-dockerhub: + name: Docker Build UBI Image for DockerHub + needs: + - get-product-version + - build + runs-on: ubuntu-latest + env: + repo: ${{github.event.repository.name}} + version: ${{needs.get-product-version.outputs.product-version}} + + steps: + - uses: actions/checkout@v2 + + # Strip everything but MAJOR.MINOR from the version string and add a `-dev` suffix + # This naming convention will be used ONLY for per-commit dev images + - name: Set docker dev tag + run: | + version="${{ env.version }}" + echo "dev_tag=${version%.*}-dev" >> $GITHUB_ENV + + - uses: hashicorp/actions-docker-build@v1 + with: + version: ${{env.version}} + target: ubi + arch: amd64 + tags: | + docker.io/hashicorp/${{env.repo}}:${{env.version}}-ubi + public.ecr.aws/hashicorp/${{env.repo}}:${{env.version}}-ubi + dev_tags: | + docker.io/hashicorppreview/${{ env.repo }}:${{ env.dev_tag }}-ubi + docker.io/hashicorppreview/${{ env.repo }}:${{ env.dev_tag }}-ubi-${{ github.sha }} + smoke_test: .github/scripts/verify_docker.sh v${{ env.version }} + verify-linux: needs: - get-product-version