Import aus Monorepo (frischer Start)
All checks were successful
Build & Deploy / deploy (push) Successful in 10s
All checks were successful
Build & Deploy / deploy (push) Successful in 10s
This commit is contained in:
39
.gitea/workflows/deploy.yml
Normal file
39
.gitea/workflows/deploy.yml
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Build & Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
# Intern klonen (NAT-Hairpin: die öffentliche Domain ist aus dem
|
||||
# Job-Container heraus nicht erreichbar).
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
github-server-url: http://gitea:3000
|
||||
|
||||
# Kein separater Build/Test-Schritt: der Docker-Build (npm install) ist
|
||||
# der Build. Falls später Tests dazukommen: hier VOR dem Deploy einfügen.
|
||||
|
||||
- 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."
|
||||
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
|
||||
Reference in New Issue
Block a user