diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index f359c5b..7566b6a 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -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 diff --git a/e2e/keycloak/docker-compose.yaml b/e2e/keycloak/docker-compose.yaml index ea7b7e1..87e3ccb 100644 --- a/e2e/keycloak/docker-compose.yaml +++ b/e2e/keycloak/docker-compose.yaml @@ -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 diff --git a/e2e/mock/docker-compose.yaml b/e2e/mock/docker-compose.yaml index e7ff2e1..1e930a3 100644 --- a/e2e/mock/docker-compose.yaml +++ b/e2e/mock/docker-compose.yaml @@ -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 diff --git a/env.mk b/env.mk index 3527b4c..2806604 100644 --- a/env.mk +++ b/env.mk @@ -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