Skip to content

Release

Release #6

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version'
required: true
jobs:
set-env:
runs-on: ubuntu-latest
outputs:
RELEASE_VERSION: ${{ steps.set_version.outputs.RELEASE_VERSION }}
steps:
- name: Set RELEASE_VERSION from tag
if: github.event_name == 'push'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set RELEASE_VERSION from workflow input
if: github.event_name == 'workflow_dispatch'
run: echo "RELEASE_VERSION=${{ github.event.inputs.releaseVersion }}" >> $GITHUB_OUTPUT
publish-image:
name: Publish Docker image
needs: set-env
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup asdf
uses: asdf-vm/actions/setup@v1
- name: Granting private modules access
run: |
git config --global url."https://${{ secrets.CI_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build container image
run: make container
env:
GITHUB_TOKEN: ${{ secrets.MESOSPHERECI_USER_TOKEN }}
TAG: ${{ needs.set-env.outputs.RELEASE_VERSION }}
- name: Push container image
run: make push-image
env:
TAG: ${{ needs.set-env.outputs.RELEASE_VERSION }}