Skip to content

Commit

Permalink
ci: GHA workflow to release image to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
supershal committed Apr 16, 2024
1 parent d46f8b4 commit ef29499
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/workflows/release-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Release
on:
push:
tags:
- "*-d2iq.test.dev*"

# Because variables are not exported, they are not visible by child processes, e.g. make
env:
registry: ghcr.io/mesosphere

jobs:
release:
name: Release
runs-on:
- ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Login to container registry
uses: docker/login-action@v2
with:
registry: ${{ env.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
run: |
make release-ghcr
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ REGISTRY ?= gcr.io/$(shell gcloud config get-value project)
PROD_REGISTRY ?= registry.k8s.io/cluster-api-vsphere

STAGING_REGISTRY ?= gcr.io/k8s-staging-capi-vsphere
GHCR_REGISTRY ?= ghcr.io/mesosphere/cluster-api-provider-vsphere
STAGING_BUCKET ?= artifacts.k8s-staging-capi-vsphere.appspot.com

# core
Expand Down Expand Up @@ -605,7 +606,12 @@ generate-flavors: $(FLAVOR_DIR)

.PHONY: release-staging
release-staging: ## Build and push container images to the staging registry
REGISTRY=$(STAGING_REGISTRY) $(MAKE) docker-build-all docker-push-all release-alias-tag
REGISTRY=$(STAGING_REGISTRY) TAG=$(RELEASE_TAG) $(MAKE) docker-build-all docker-push-all release-alias-tag

.PHONY: release-ghcr
release-ghcr: ## Build and push container images to the staging registry
REGISTRY=$(GHCR_REGISTRY) $(MAKE) docker-build-all docker-push-all


.PHONY: release-alias-tag
release-alias-tag: ## Add the release alias tag to the last build tag
Expand Down

0 comments on commit ef29499

Please sign in to comment.