diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 85b5762..b5d1936 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -32,7 +32,7 @@ jobs: uses: docker/setup-buildx-action@v3.7.1 # Login against a Github registry except on PR - - name: Log into registry github container registry + - name: Log into github container registry if: github.event_name != 'pull_request' uses: docker/login-action@v3.3.0 with: @@ -40,12 +40,22 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + # Login for Docker registry + - name: Log into docker container registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v3.3.0 + with: + registry: docker.io + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + # Build and push Docker image with Buildx (don't push on PR) - name: Build and push Docker image id: build-and-push uses: docker/bake-action@v5.11.0 with: push: ${{ github.event_name != 'pull_request' }} + set: variable=TAG,value=${{ steps.meta.outputs.tags }} # Sign the resulting Docker image digest except on PRs. - name: Sign the published Docker image diff --git a/Dockerfile b/Dockerfile index 48e50e7..64c5a25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,5 @@ FROM debian:stable-20241202-slim -LABEL org.opencontainers.image.authors="Nicholas Malcolm" -LABEL org.opencontainers.image.source="https://github.com/bubylou/steamcmd-docker" - ENV USER=steam ENV PUID=1000 diff --git a/docker-bake.hcl b/docker-bake.hcl index f6fb5d7..30a4527 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -2,21 +2,18 @@ group "default" { targets = ["main", "wine"] } -variable "REGISTRY" { - default = "ghcr.io" -} - variable "REPO" { default = "bubylou/steamcmd" } variable "TAG" { - default = "v1.3.2" + default = "latest" } -function "tag" { - params = [tag] - result = "${REGISTRY}/${REPO}:${tag}" +function "tags" { + params = [suffix] + result = ["ghcr.io/${REPO}:latest${suffix}", "ghcr.io/${REPO}:${TAG}${suffix}", + "docker.io/${REPO}:latest${suffix}", "docker.io/${REPO}:${TAG}${suffix}"] } target "main" { @@ -30,7 +27,7 @@ target "main" { "org.opencontainers.image.licenses" = "MIT" } platforms = ["linux/amd64"] - tags = [tag("latest"), tag("${TAG}")] + tags = tags("") } target "wine" { @@ -38,5 +35,5 @@ target "wine" { args = { WINE_ENABLED = true } - tags = [tag("latest-wine"), tag("${TAG}-wine")] + tags = tags("-wine") }