59 lines
1.6 KiB
YAML
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/
|