Denys Konovalov 4d4aa8ad84
Some checks failed
Schülerzeitung Prod/Test / Produktivumgebung (push) Successful in 14s
Schülerzeitung Prod/Test / Testumgebung (push) Failing after 3s
Temporarily use old Hugo version
2025-01-28 12:59:30 +01:00

64 lines
1.7 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: Setup Hugo
uses: https://github.com/peaceiris/actions-hugo@v3
with:
hugo-version: '0.123.0'
extended: true
- 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/