47 lines
1.4 KiB
YAML
47 lines
1.4 KiB
YAML
# Container image build (Gitea Actions): builds the Dockerfile and pushes it to the Gitea registry
|
|
# on every push to main (main is protected: only merged PRs with green tests land there).
|
|
#
|
|
# Repository variables (Settings → Actions → Variables):
|
|
# DOCKER_REPO registry host, e.g. gitea.gnilebein.de
|
|
# IMAGE_NAME image name, e.g. plenario
|
|
# Repository secrets:
|
|
# PAT personal access token with package write permission
|
|
#
|
|
# Image: ${DOCKER_REPO}/${owner}/${IMAGE_NAME}:latest and :<commit sha>
|
|
name: Container Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
docker-build-image:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v4
|
|
with:
|
|
registry: ${{ vars.DOCKER_REPO }}
|
|
username: ${{ gitea.actor }}
|
|
password: ${{ secrets.PAT }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
file: ./Dockerfile
|
|
platforms: linux/amd64
|
|
pull: true
|
|
push: true
|
|
provenance: false
|
|
tags: |
|
|
${{ vars.DOCKER_REPO }}/${{ gitea.repository_owner }}/${{ vars.IMAGE_NAME }}:latest
|
|
${{ vars.DOCKER_REPO }}/${{ gitea.repository_owner }}/${{ vars.IMAGE_NAME }}:${{ gitea.sha }}
|