diff --git a/.github/workflows/container_build_and_push.yml b/.github/workflows/container_build_and_push.yml index cc70dad..771e1f1 100644 --- a/.github/workflows/container_build_and_push.yml +++ b/.github/workflows/container_build_and_push.yml @@ -15,17 +15,23 @@ jobs: runs-on: ubuntu-latest steps: + - name: Get repository basename + id: repo-basename + run: | + echo "value=`basename ${{ github.repository }}`" >> $GITHUB_OUTPUT + shell: bash + - name: Check out the repo uses: actions/checkout@v3 - name: Log in to Docker Hub - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_HUB_USERNAME }} password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.actor }} @@ -33,27 +39,27 @@ jobs: - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v4 + uses: docker/metadata-action@v5 with: images: | - ${{ github.repository }} + ${{ secrets.DOCKER_HUB_USERNAME }}/${{ steps.repo-basename.outputs.value }} ghcr.io/${{ github.repository }} - name: Set up QEMU - uses: docker/setup-qemu-action@v2 + uses: docker/setup-qemu-action@v3 with: platforms: linux/amd64,linux/arm64,linux/arm/8,linux/arm/7,linux/arm/6 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v2 + uses: docker/setup-buildx-action@v3 - name: Available platforms run: echo ${{ steps.buildx.outputs.platforms }} - name: Build and push id: docker_build - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: platforms: linux/amd64,linux/arm64,linux/arm/8,linux/arm/7,linux/arm/6 context: .