Denys Konovalov 204527ec6d
All checks were successful
Schülerzeitung Prod/Test / Produktivumgebung (push) Successful in 7s
Schülerzeitung Prod/Test / Testumgebung (push) Successful in 5s
Use old Hugo version for test build
2025-01-28 13:04:26 +01:00

69 lines
1.9 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: 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 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/