This repository has been archived by the owner on Dec 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github action to push image when release is published
added a github action to build and push the docker image to quay when release is published Signed-off-by: Madhu Rajanna <[email protected]>
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 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,48 @@ | ||
name: Publish Docker image | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
push: | ||
name: Push Image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
go: ["1.15"] | ||
steps: | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
|
||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Login to Quay | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: quay.io | ||
username: ${{ secrets.QUAY_USERNAME }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: copy volume-replication-operator repo in go src | ||
run: | | ||
mkdir -p /home/runner/go/src/github.com/csi-addons | ||
cp -r /home/runner/work/volume-replication-operator/volume-replication-operator /home/runner/go/src/github.com/csi-addons | ||
- name: run docker-push | ||
working-directory: "/home/runner/go/src/github.com/csi-addons/volume-replication-operator" | ||
env: | ||
GOPATH: /home/runner/go | ||
run: | | ||
export PATH=$PATH:$GOPATH/bin | ||
export VERSION="2.3.2" | ||
wget https://github.com/kubernetes-sigs/kubebuilder/releases/download/v"$VERSION"/kubebuilder_"$VERSION"_linux_amd64.tar.gz | ||
tar -zxvf kubebuilder_"$VERSION"_linux_amd64.tar.gz | ||
export KUBEBUILDER_ASSETS="$(pwd)/kubebuilder_"$VERSION"_linux_amd64/bin" | ||
# build and push image with released tag | ||
IMG_TAG=${{ github.ref }} make docker-build | ||
IMG_TAG=${{ github.ref }} make docker-push |