gitea act_runner exposes GITHUB_* not GITEA_* variable aliases; switch to GITHUB_REF_NAME and GITHUB_OUTPUT so tag extraction works. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1.5 KiB
YAML
49 lines
1.5 KiB
YAML
name: Release Image
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Derive image tags
|
|
id: meta
|
|
shell: bash
|
|
run: |
|
|
VERSION="${GITHUB_REF_NAME#v}"
|
|
MAJOR_MINOR="$(printf '%s' "$VERSION" | awk -F. '{print $1"."$2}')"
|
|
{
|
|
echo "version=$VERSION"
|
|
echo "major_minor=$MAJOR_MINOR"
|
|
echo "image=registry.ginnoir.com/ginnoir/famapp"
|
|
} >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Install docker
|
|
run: apt-get update -qq && apt-get install -y -qq docker.io
|
|
|
|
- name: Login to registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_PUSH_PASSWORD }}" | docker login registry.ginnoir.com \
|
|
--username "${{ secrets.REGISTRY_PUSH_USERNAME }}" \
|
|
--password-stdin
|
|
|
|
- name: Build image
|
|
run: |
|
|
docker build \
|
|
-t "${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}" \
|
|
-t "${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.major_minor }}" \
|
|
-t "${{ steps.meta.outputs.image }}:latest" \
|
|
.
|
|
|
|
- name: Push image
|
|
run: |
|
|
docker push "${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.version }}"
|
|
docker push "${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.major_minor }}"
|
|
docker push "${{ steps.meta.outputs.image }}:latest"
|