Update to gitea actions
Build and Push Docker Images / build-and-push (./admin_ui, admin_ui) (push) Successful in 1m23s
Build and Push Docker Images / build-and-push (./auth_api, auth_api) (push) Successful in 1m2s
Build and Push Docker Images / build-and-push (./employee_api, employee_api) (push) Successful in 1m6s
Build and Push Docker Images / build-and-push (./error_log_api, error_log_api) (push) Successful in 1m13s
Build and Push Docker Images / build-and-push (./transit_api, transit_api) (push) Successful in 1m1s

This commit is contained in:
Sven laptop
2026-09-16 18:35:43 +02:00
parent 9a56b40f50
commit e95b10abbb
3 changed files with 84 additions and 245 deletions
+78
View File
@@ -0,0 +1,78 @@
name: Build and Push Docker Images
on:
push:
branches:
- main
- develop
paths:
- "auth_api/**"
- "employee_api/**"
- "transit_api/**"
- "error_log_api/**"
- "admin_ui/**"
- ".gitea/workflows/docker-build.yml"
pull_request:
branches:
- main
- develop
env:
REGISTRY: gitea.testinstance.nl
IMAGE_NAMESPACE: sven/the-transit-project
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: auth_api
context: ./auth_api
- name: employee_api
context: ./employee_api
- name: transit_api
context: ./transit_api
- name: error_log_api
context: ./error_log_api
- name: admin_ui
context: ./admin_ui
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Set image tags
id: tags
shell: bash
run: |
image_base="${{ env.REGISTRY }}/${{ env.IMAGE_NAMESPACE }}/${{ matrix.name }}"
image_tags="${image_base}:${{ gitea.sha }}"
if [[ "${{ gitea.event_name }}" == "push" && "${{ gitea.ref_name }}" == "main" ]]; then
image_tags+=$'\n'"${image_base}:latest"
fi
{
echo 'tags<<EOF'
echo "$image_tags"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ${{ matrix.context }}
push: ${{ gitea.event_name == 'push' }}
tags: ${{ steps.tags.outputs.tags }}