Release #4
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
name: release | |
on: | |
push: | |
tags: [v*] | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: tp2intervals | |
jobs: | |
get-version: | |
name: Get version | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.get-version.outputs.version }} | |
steps: | |
- id: get-version | |
run: | | |
# Strip git ref prefix from version | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
# Strip "v" prefix from tag name | |
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//') | |
# Use Docker `latest` tag convention | |
[ "$VERSION" == "main" ] && VERSION=latest | |
echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
docker: | |
name: Docker Image Release | |
runs-on: ubuntu-latest | |
needs: | |
- get-version | |
steps: | |
- env: | |
version: ${{needs.get-version.outputs.version}} | |
run: echo "$version" |