Skip to content

Fix prefix of image

Fix prefix of image #3

Workflow file for this run

name: Build and Push Docker Image
on:
push:
branches:
- release/v*.*.*
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
# Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Extract the version (v*.*.*) from the branch name
- name: Extract version
id: extract_version
run: echo "VERSION=${GITHUB_REF_NAME##*/}" >> $GITHUB_ENV
# Log in to GitHub Container Registry
- name: Log in to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build and Push the Docker Image
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.VERSION }}
ghcr.io/${{ github.repository }}:latest