generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Harsh Thakur <harshthakur9030@gmail.com>
- Loading branch information
1 parent
f354fe4
commit aa6f05a
Showing
2 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
tags: | ||
- v* | ||
|
||
|
||
env: | ||
GITHUB_SHA: ${{ github.sha }} | ||
GITHUB_REF: ${{ github.ref }} | ||
|
||
|
||
jobs: | ||
hnc-manager: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: Set Release Tag | ||
run: | | ||
TAG="${GITHUB_REF#refs/*/v}" | ||
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV | ||
- name: Set Build Date | ||
id: date | ||
run: | | ||
echo "::set-output name=DATE::$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" | ||
# Setup gcloud CLI | ||
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master | ||
with: | ||
version: '270.0.0' | ||
service_account_key: ${{ secrets.GCR_KEY }} | ||
|
||
|
||
# Configure docker to use the gcloud command-line tool as a credential helper | ||
- run: | | ||
# Set up docker to authenticate | ||
# via gcloud command-line tool. | ||
gcloud auth configure-docker | ||
- name: Docker meta | ||
id: docker_meta | ||
uses: crazy-max/ghaction-docker-meta@v1 | ||
with: | ||
# add each registry to which the image needs to be pushed here | ||
images: | | ||
gcr.io/k8s-staging-multitenancy/hnc-manager | ||
tag-latest: true | ||
tag-semver: | | ||
{{version}} | ||
- name: Print Tags | ||
run: | | ||
echo "${{ steps.docker_meta.outputs.tags }}" | ||
echo "RELEASE TAG: ${RELEASE_TAG}" | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
with: | ||
platforms: all | ||
|
||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v1 | ||
with: | ||
version: v0.5.1 | ||
|
||
|
||
- name: Build & Push Image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
platforms: linux/amd64, linux/arm64, linux/arm/v7 | ||
tags: | | ||
${{ steps.docker_meta.outputs.tags }} | ||
build-args: | | ||
DBUILD_DATE=${{ steps.date.outputs.DATE }} | ||
DBUILD_REPO_URL=https://github.com/kubernetes-sigs/hierarchical-namespaces |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters