diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index f6c911e..6e89814 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -7,19 +7,19 @@ on: - devel jobs: - - build: + build-and-push-image: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: GHCR login + - name: GHCR login and image tags env: GHCR_USERNAME: ${{ github.actor }} GHCR_TOKEN: ${{ secrets.REGISTRY_TOKEN }} run: echo "${GHCR_TOKEN}" | docker login ghcr.io --username "${GHCR_USERNAME}" --password-stdin - - name: Build the Docker image + - name: Set tag + id: settag run: | GHCR_IMAGE=ghcr.io/grycap/oscar-metrics if [[ $GITHUB_REF == refs/heads/devel ]]; then @@ -27,4 +27,12 @@ jobs: else TAG="${GHCR_IMAGE}:latest" fi - docker build . --file Dockerfile --output "type=image,push=true" --tag ${TAG} + echo ::set-output name=tag::${TAG} + - name: Build the Docker image + id: push + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.settag.outputs.tag }} +#docker build . --file Dockerfile --output "type=image,push=true" --tag ${TAG}