Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Fix step

Fix step #2

name: Create and publish a Docker image
on:
workflow_dispatch:
inputs:
image-tag:
type: string
required: true
description: 'Docker image tag'
push:
env:
REGISTRY: ghcr.io
REPOSITORY: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Export docker tag
run: echo "IMAGE_TAG=${{ inputs.image-tag || `git describe --tags | sed 's/V//'` }}" >> $GITHUB_ENV

Check failure on line 34 in .github/workflows/build-push-image.yml

View workflow run for this annotation

GitHub Actions / Create and publish a Docker image

Invalid workflow file

The workflow is not valid. .github/workflows/build-push-image.yml (Line: 34, Col: 15): Unexpected symbol: '`git'. Located at position 21 within expression: inputs.image-tag || `git describe --tags | sed 's/V//'`
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,windows/amd64
push: true
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}:${{ env.IMAGE_TAG }}