photo26/.forgejo/workflows/docker.yml
krek0 4bc1afa0cb
All checks were successful
Docker / build (push) Successful in 28s
Add Docker support with Dockerfile and entrypoint
2026-05-03 11:36:34 +02:00

44 lines
1.2 KiB
YAML

name: Docker
on:
push:
branches:
- master
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set image tag
id: meta
run: |
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "TAG=latest" >> $GITHUB_OUTPUT
fi
- name: Login to Forgejo registry
uses: docker/login-action@v3
with:
registry: git.sinfonie.org
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build image
run: |
docker build -t git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} .
- name: Push image
run: |
docker push git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }}
- name: Tag latest (for master)
if: github.ref == 'refs/heads/master'
run: |
docker tag git.sinfonie.org/sinfonie/photo26:${{ steps.meta.outputs.TAG }} git.sinfonie.org/sinfonie/photo26:latest
docker push git.sinfonie.org/sinfonie/photo26:latest