Skip to content

Commit

Permalink
Push to docker.io registry
Browse files Browse the repository at this point in the history
  • Loading branch information
bubylou committed Dec 18, 2024
1 parent e8f43b4 commit 593c95f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,30 @@ jobs:
uses: docker/[email protected]

# 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/[email protected]
with:
registry: ghcr.io
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/[email protected]
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/[email protected]
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
Expand Down
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
17 changes: 7 additions & 10 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -30,13 +27,13 @@ target "main" {
"org.opencontainers.image.licenses" = "MIT"
}
platforms = ["linux/amd64"]
tags = [tag("latest"), tag("${TAG}")]
tags = tags("")
}

target "wine" {
inherits = ["main"]
args = {
WINE_ENABLED = true
}
tags = [tag("latest-wine"), tag("${TAG}-wine")]
tags = tags("-wine")
}

0 comments on commit 593c95f

Please sign in to comment.