Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

Commit

Permalink
Publish docker images to ghcr (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
nacx authored Mar 1, 2024
1 parent d9970c1 commit 130d581
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 14 deletions.
19 changes: 9 additions & 10 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,20 @@ jobs:
if: ${{ github.ref_type == 'tag' }}
shell: bash
run: |
# Set the RELEASE_TAG to force the version of the Docker images
echo "DOCKER_TAG=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
# Set the VERSION to force the version of the Docker images
echo "VERSION=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_INTERNAL_CONTAINERS_SERVICE_ACCOUNT_KEY }}
- uses: "google-github-actions/setup-gcloud@v1"
- run: "gcloud info"
shell: bash
- run: "gcloud auth configure-docker"
shell: bash

- run: make check

- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- run: make docker-push
2 changes: 1 addition & 1 deletion e2e/keycloak/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ services:
condition: service_completed_successfully
idp-proxy:
condition: service_started
image: gcr.io/tetrate-internal-containers/authservice:latest-${ARCH:-amd64}
image: ${DOCKER_HUB}/authservice:latest-${ARCH:-amd64}
platform: linux/${ARCH:-amd64}
volumes:
- type: bind
Expand Down
2 changes: 1 addition & 1 deletion e2e/mock/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ services:

# This is the `authservice` image that should be up-to-date when running the tests.
ext-authz:
image: gcr.io/tetrate-internal-containers/authservice:latest-${ARCH:-amd64}
image: ${DOCKER_HUB}/authservice:latest-${ARCH:-amd64}
platform: linux/${ARCH:-amd64}
volumes:
- type: bind
Expand Down
11 changes: 9 additions & 2 deletions env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,18 @@ ENVTEST ?= sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
NAME ?= authservice
TARGETS ?= linux-amd64 linux-arm64 #darwin-amd64 darwin-arm64

DOCKER_HUB ?= gcr.io/tetrate-internal-containers
DOCKER_TAG ?= $(shell git rev-parse HEAD)
# DOCKER_HUB is exported so that it can be referenced in e2e docker compose files
export DOCKER_HUB ?= $(GO_MODULE:github.com/%=ghcr.io/%)
DOCKER_TARGETS ?= linux-amd64 linux-arm64
DOCKER_BUILDER_NAME ?= $(NAME)-builder

ifneq ($(strip $(VERSION)),)
# Remove the suffix as we want N.N.N instead of vN.N.N
DOCKER_TAG ?= $(strip $(VERSION:v%=%))
else
DOCKER_TAG ?= $(shell git rev-parse HEAD)
endif

export ARCH := $(shell uname -m)
ifeq ($(ARCH),x86_64)
export ARCH := amd64
Expand Down

0 comments on commit 130d581

Please sign in to comment.