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

Publish docker images to ghcr #69

Merged
merged 3 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
10 changes: 8 additions & 2 deletions env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ 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 ?= $(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
Loading