Skip to content

chore: update build pipeline #3

chore: update build pipeline

chore: update build pipeline #3

Workflow file for this run

name: Create and publish a Docker image
on:
release:
types: [published]
workflow_dispatch:
version:
description: 'Build version'
required: true
type: string
skip_tests:
description: 'Skip tests'
required: true
type: boolean
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ 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: Log in to the Container registry
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/[email protected]
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Configure build
id: configure-build
run: |
if [ ! -z "${{ github.release.name }}" ]; then
echo "release"
echo "version=${{ github.release.name }}" >> "$GITHUB_OUTPUT"
echo "skip-tests=false" >> "$GITHUB_OUTPUT"
elif [ ! -z "${{ github.inputs.version }}" ]; then
echo "manual"
echo "version=${{ github.inputs.version }}" >> "$GITHUB_OUTPUT"
echo "skip-tests=${{ github.inputs.skip_tests }}" >> "$GITHUB_OUTPUT"
else
echo "snapshot"
echo "version=SNAPSHOT" >> "$GITHUB_OUTPUT"
echo "skip-tests=true" >> "$GITHUB_OUTPUT"
fi
outputs:

Check failure on line 54 in .github/workflows/release.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/release.yaml

Invalid workflow file

You have an error in your yaml syntax on line 54
selected-stage: ${{ steps.select-stage.outputs.selected-stage }}
- name: Build and push Docker image
uses: docker/[email protected]
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"VER=${{ steps.configure-build.outputs.version }}"
"SKIP_TESTS=${{ steps.configure-build.outputs.skip-tests }}"