schuelerzeitung/.gitea/workflows/prod.yml
Denys Konovalov b93a743492
All checks were successful
Schülerzeitung Prod/Test / Produktivumgebung (push) Successful in 2s
Schülerzeitung Prod/Test / Testumgebung (push) Successful in 1s
.gitea/workflows/prod.yml aktualisiert
2024-07-07 12:01:26 +02:00

59 lines
1.6 KiB
YAML

name: Schülerzeitung Prod/Test
on:
push:
branches: [main]
defaults:
run:
working-directory: /opt/runner/workdir/schuelerzeitung-main
jobs:
prod-build:
name: Produktivumgebung
if: gitea.repository == 'gcg/schuelerzeitung'
runs-on: act-runner-user
steps:
- name: Pull
run: |
git fetch --all
git reset --hard origin/main
- name: Build
run: |
rm -rf public
hugo --minify --gc --baseURL "https://schuelerzeitung-gcg.de/"
- name: Deploy
run: |
cd public
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung/
- name: Notification (GCG.IT Administration)
uses: actions/telegram-action@main
if: always()
with:
chat_id: ${{ secrets.TG_CHAT_ID }}
token: ${{ secrets.TG_TOKEN }}
- name: Notification (Schülerzeitung)
uses: actions/telegram-action@main
if: always()
with:
chat_id: ${{ secrets.SZ_CHAT_ID }}
token: ${{ secrets.TG_TOKEN }}
test-build:
name: Testumgebung
if: gitea.repository == 'gcg/schuelerzeitung'
runs-on: act-runner-user
steps:
- name: Pull
run: |
git fetch --all
git reset --hard origin/main
- name: Build
run: |
rm -rf test
hugo --minify --gc --baseURL "https://test.schuelerzeitung-gcg.de/" --buildDrafts --buildFuture -d test
- name: Deploy
run: |
cd test
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung-test/