diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index a47b11ec6..7ccc9729b 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -18,14 +18,16 @@ jobs: contents: read attestations: write steps: - - uses: actions/checkout@v4 - - name: Build image - run: | - docker build . --no-cache \ - --file Dockerfile --tag $IMAGE_NAME --label "runnumber=${{ github.run_id }}" - - name: Log in to registry - run: docker login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} - - name: Push image - run: | - docker tag $IMAGE_NAME ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest - docker push ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME:latest + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + tags: ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest