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

Commit

Permalink
add github action to push image when release is published
Browse files Browse the repository at this point in the history
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
Madhu-1 committed Apr 15, 2021
1 parent 966c5ad commit faf6e90
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/docker-publish.yaml
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

0 comments on commit faf6e90

Please sign in to comment.