Skip to content

feat: intoduce TAG_PREFIX instead of RELEASE_TAG_PREFIX #11

feat: intoduce TAG_PREFIX instead of RELEASE_TAG_PREFIX

feat: intoduce TAG_PREFIX instead of RELEASE_TAG_PREFIX #11

Workflow file for this run

name: pipeline
on:
push:
tags:
- '**'
env:
image_name: semver-action
jobs:
build:
runs-on: ubuntu-20.04
steps:
-
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: all
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
-
name: Calculate image version
id: get_variables
run: |
version=$(echo $GITHUB_REF | cut -d/ -f3- | sed 's/\//-/g')
echo "version=${version}" >> $GITHUB_OUTPUT
-
name: Build docker image and push it
uses: docker/build-push-action@v4
with:
context: .
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
kvendingoldo/${{ env.image_name }}:latest
kvendingoldo/${{ env.image_name }}:${{ steps.get_variables.outputs.version }}