Files
ci-image/.gitea/workflows/docker.yml
T
Workflow config file is invalid. Please check your config file: yaml: construct errors: line 1: (Line: 24, Col: 18): Unrecognized named-value: 'GITHUB_REPOSITORY'. Located at position 1 within expression: GITHUB_REPOSITORY (Line: 35, Col: 18): Unrecognized named-value: 'GITHUB_REPOSITORY'. Located at position 1 within expression: GITHUB_REPOSITORY
2026-01-01 22:12:48 +01:00

42 lines
1.1 KiB
YAML

name: Build and Push Docker Image
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: eiche:3000
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build Docker Image
env:
REGESTRY: eiche:3000
IMAGE: ${{ GITHUB_REPOSITORY }}
run: |
# Build the image with the commit hash tag
docker build -t ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER} .
# Tag the same image as "latest"
docker tag ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER} ${REGISTRY}/${IMAGE}:latest
- name: Push Docker Images
env:
REGESTRY: eiche:3000
IMAGE: ${{ GITHUB_REPOSITORY }}
run: |
docker push ${REGISTRY}/${IMAGE}:${GITHUB_RUN_NUMBER}
docker push ${REGISTRY}/${IMAGE}:latest
- name: Log out from registry
if: always()
run: docker logout eiche:3000