Skip to content

Release

Release #4

Workflow file for this run

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"