Files
Skori/.gitea/workflows/docker-build.yml
T
Zed ce1db937f2
Build and Publish Docker Image / build-and-push-image (push) Successful in 1m48s
rework pwa cc
2026-07-11 02:01:08 +02:00

45 lines
1.4 KiB
YAML

name: Build and Publish Docker Image
on:
push:
branches:
- master
env:
REGISTRY: 192.168.10.174:3000
IMAGE_NAME: ${{ gitea.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Simple login directly with docker login
- name: Log in to the Container registry
run: echo "${{ secrets.DOCKER_TOKEN }}" | docker login ${{ env.REGISTRY }} -u "${{ gitea.actor }}" --password-stdin
# Frontend image (nginx + SPA)
- name: Build frontend Docker image
run: |
LOWERCASE_IMAGE=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
docker build -t ${{ env.REGISTRY }}/$LOWERCASE_IMAGE:latest .
- name: Push frontend Docker image
run: |
LOWERCASE_IMAGE=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
docker push ${{ env.REGISTRY }}/$LOWERCASE_IMAGE:latest
# Backend image (Express API)
- name: Build backend Docker image
run: |
LOWERCASE_IMAGE=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
docker build -t ${{ env.REGISTRY }}/$LOWERCASE_IMAGE-backend:latest ./server
- name: Push backend Docker image
run: |
LOWERCASE_IMAGE=$(echo "${{ env.IMAGE_NAME }}" | tr '[:upper:]' '[:lower:]')
docker push ${{ env.REGISTRY }}/$LOWERCASE_IMAGE-backend:latest