Files
skrift-app/.gitea/workflows/deploy.yml
Lucas Orth 32aa0a549f
All checks were successful
Build & Deploy / deploy (push) Successful in 26s
Import aus Monorepo (frischer Start)
2026-08-24 12:13:54 +02:00

41 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build & Deploy
on:
push:
tags:
- 'v*'
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# Intern klonen (NAT-Hairpin: öffentliche Domain aus dem Job-Container
# nicht erreichbar).
- uses: actions/checkout@v4
with:
github-server-url: http://gitea:3000
# Der Vite-Build läuft im Docker-Build (mehrstufiges Dockerfile). Die
# .env liefert VITE_DIRECTUS_URL (Build-Arg) – Compose liest sie beim
# `up --build` automatisch für die Variablen-Ersetzung.
- name: Tag ermitteln
run: echo "IMAGE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: .env aus Secret erzeugen
env:
DOTENV: ${{ secrets.DOTENV }}
run: |
if [ -z "$DOTENV" ]; then
echo "Secret DOTENV ist leer oder nicht gesetzt (mind. VITE_DIRECTUS_URL)."
exit 1
fi
umask 077
echo "$DOTENV" > .env
- name: Deployen
run: docker compose up -d --build --remove-orphans --wait --wait-timeout 180
- name: Alte Layer aufräumen
run: docker image prune -f