Skip to content

Commit

Permalink
github action for pushing release images to quay.io
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrove-oss committed Feb 6, 2024
1 parent 371348d commit 942c97a
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Actions to take when a release is tagged

name: release

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
runs-on: ubuntu-latest
if: github.repository == 'project-codeflare/appwrapper'
steps:
- name: checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: validate tag format
run: |
if [[ ${GITHUB_REF_NAME} =~ ^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$ ]]; then
echo "Tag format is valid."
else
echo "Invalid tag format: ${GITHUB_REF_NAME}"
exit 1
fi
- name: docker login
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and Push Images
run: |
make docker-buildx -e TAG=${GITHUB_REF_NAME} -e quay_repository=quay.io/ibm
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,16 @@ build-installer: manifests generate kustomize ## Generate a consolidated YAML wi
echo "---" >> dist/install.yaml # Add a document separator before appending
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default >> dist/install.yaml
@$(call clean-manifests)

##@ Deployment

ifndef ignore-not-found
ignore-not-found = false
endif

clean-manifests = (cd config/manager && $(KUSTOMIZE) edit set image controller=quay.io/ibm/appwrapper)

.PHONY: install
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
Expand All @@ -178,6 +181,7 @@ uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -
@$(call clean-manifests)

.PHONY: undeploy
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
Expand Down
3 changes: 1 addition & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: appwrapper
newTag: webhook-6c10328db7ee650dac813065b927056fc6954210
newName: quay.io/ibm/appwrapper

0 comments on commit 942c97a

Please sign in to comment.