From a79e24039cdb6c3da824a3e5288842b92cfeb2ed Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 26 Oct 2024 15:02:40 +0200 Subject: [PATCH] Fixes added to the docker-build-push job --- .github/workflows/docker-build-push.yml | 32 ++++++++++++++++--------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 08a1a58..7dd4ef9 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -4,20 +4,30 @@ on: push: branches: [main] pull_request: - branches: [main] jobs: - build: + docker: runs-on: ubuntu-latest steps: - - uses: docker/login-action@v1 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Harbor + uses: docker/login-action@v3 with: - registry: ${{ secrets.DOCKER_REGISTRY_URL }} - username: ${{ secrets.DOCKER_REGISTRY_USER }} + registry: ${{ secrets.DOCKER_REGISTRY_URL }} + username: ${{ secrets.DOCKER_REGISTRY_USER }} password: ${{ secrets.DOCKER_REGISTRY_PASS }} - - - uses: actions/checkout@v3 - - name: BuildAndPushImageOnHarbor - run: | - docker build ./ -t ${{ secrets.DOCKER_REGISTRY_URL }}/breizhcamp/kalon:${{ github.run_number }} - docker push ${{ secrets.DOCKER_REGISTRY_URL }}/breizhcamp/kalon:${{ github.run_number }} + - + name: Build and push + uses: docker/build-push-action@v6 + env: + DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY_URL }} + DOCKER_REPOSITORY: breizhcamp/kalon + with: + push: true + tags: $HARBOR_REGISTRY/$DOCKER_REPOSITORY:latest