try a different way of publishing

This commit is contained in:
Raymond Kuiper 2024-03-13 11:47:45 +01:00
parent 3a39c314be
commit 4b7f3ec0b9

View File

@ -19,10 +19,33 @@ jobs:
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: 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
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GHCR_PAT }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{ version }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}