diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index 86f9fcd..e9e6421 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -18,22 +18,15 @@ jobs: build_and_publish: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 -# - name: Login to ghcr.io -# run: echo "${{ secrets.GHCR_PAT }}" | docker login --username ${{ github.actor }} --password-stdin ${{ env.REGISTRY }} -# - name: Build and tag image -# run: docker build . -t ${{ env.REGISTRY}}/${{ env.IMAGE_NAME }}:latest -# - name: Push image to ghcr.io -# run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - - - name: Log in to the Container registry + - name: Checkout sources + uses: actions/checkout@v4 + - name: Log in to the container registry uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GHCR_PAT }} - - - name: Extract metadata (tags, labels) for Docker + - name: Extract metadata (tags, labels) id: meta uses: docker/metadata-action@v5 with: @@ -41,7 +34,8 @@ jobs: tags: | type=semver,pattern={{ version }} type=ref,event=branch - + type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }} + type=sha - name: Build and push Docker image uses: docker/build-push-action@v5 with: