diff --git a/.github/workflows/build-production-container.yml b/.github/workflows/build-production-container.yml index d97e534..54caab7 100644 --- a/.github/workflows/build-production-container.yml +++ b/.github/workflows/build-production-container.yml @@ -20,29 +20,38 @@ jobs: username: ${{ secrets.DOCKER_HUB_USER }} password: ${{ secrets.DOCKER_HUB_TOKEN }} - name: Build test image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: - tags: metacpan/metacpan-api-v0-shim:test + tags: ${{ github.repository }}:test target: test push: false - name: Run Perl tests - run: docker run -i metacpan/metacpan-api-v0-shim:test + run: docker run -i ${{ github.repository }}:test - name: Docker meta id: meta uses: docker/metadata-action@v5 with: - images: metacpan/metacpan-api-v0-shim - flavour: | + images: ${{ github.repository }} + flavor: | latest=false tags: | type=sha type=ref,event=branch type=ref,event=pr type=raw,value=latest,enable={{is_default_branch}} - - run: echo '${{ steps.meta.outputs.json }}' + - name: Docker meta (sha) + id: docker-sha-tag + uses: docker/metadata-action@v5 + with: + images: ${{ github.repository }} + flavor: | + latest=false + tags: | + type=sha - name: Build and push uses: docker/build-push-action@v5 with: tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }} + - if: contains( fromJSON(steps.meta.outputs.json).tags, "${{ github.repository }}:latest") + run: echo 'need update to ${{ steps.docker-sha-tag.outputs.tags }}'