From 2a5218c52a6b94cbd66bc83a98cf7263c054b78a Mon Sep 17 00:00:00 2001 From: Sean Eagan Date: Wed, 31 Mar 2021 14:57:55 -0500 Subject: [PATCH] Add release automation for image tags Relates-To: #13 Signed-off-by: Sean Eagan Change-Id: Iecfc6e4ddf456ec2bd5269829fbbf6ea9024ce83 --- .github/workflows/release.yaml | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..af89256 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,44 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: release + +# Expects git tags semver format e.g. v1.2.3 +on: + push: + tags: + - 'v*' + +jobs: + release-image: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Login to image registry + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + - name: Publish semver image tags + run: | + set -x + set -e + + export IMAGE_TAG=$(echo "${TAG_REF}" | sed -e 's|refs/tags/||') + export COMMIT="$COMMIT" + export PUSH_IMAGE="true" + make images + env: + TAG_REF: ${{ github.ref }} + COMMIT: ${{ github.sha }}