schuelerzeitung/.gitea/workflows/prod.yml

59 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2024-07-07 12:01:26 +02:00
name: Schülerzeitung Prod/Test
2023-03-26 15:44:45 +02:00
on:
push:
2024-07-07 12:01:26 +02:00
branches: [main]
2023-03-26 15:44:45 +02:00
2023-10-21 21:10:05 +02:00
defaults:
run:
2023-12-30 22:08:16 +01:00
working-directory: /opt/runner/workdir/schuelerzeitung-main
2023-10-21 21:10:05 +02:00
2023-03-26 15:44:45 +02:00
jobs:
prod-build:
2024-07-07 12:01:26 +02:00
name: Produktivumgebung
2023-10-21 13:52:17 +02:00
if: gitea.repository == 'gcg/schuelerzeitung'
2023-03-26 15:44:45 +02:00
runs-on: act-runner-user
steps:
2023-12-30 22:08:16 +01:00
- name: Pull
2023-10-21 13:52:17 +02:00
run: |
git fetch --all
git reset --hard origin/main
2023-12-30 22:08:16 +01:00
- name: Build
2023-10-21 13:52:17 +02:00
run: |
rm -rf public
2023-10-21 20:25:30 +02:00
hugo --minify --gc --baseURL "https://schuelerzeitung-gcg.de/"
2023-12-30 22:08:16 +01:00
- name: Deploy
2023-03-26 15:44:45 +02:00
run: |
2023-10-21 21:10:05 +02:00
cd public
2023-12-30 22:12:21 +01:00
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung/
2024-07-07 12:01:26 +02:00
- name: Notification (GCG.IT Administration)
uses: actions/telegram-action@main
2023-03-26 15:44:45 +02:00
if: always()
with:
chat_id: ${{ secrets.TG_CHAT_ID }}
token: ${{ secrets.TG_TOKEN }}
2024-07-07 12:01:26 +02:00
- name: Notification (Schülerzeitung)
2024-01-19 21:18:50 +01:00
uses: actions/telegram-action@main
2023-12-30 22:11:51 +01:00
if: always()
2023-12-30 22:08:16 +01:00
with:
2024-01-19 21:18:50 +01:00
chat_id: ${{ secrets.SZ_CHAT_ID }}
token: ${{ secrets.TG_TOKEN }}
2023-12-30 22:08:16 +01:00
2023-03-26 15:44:45 +02:00
test-build:
2024-07-07 12:01:26 +02:00
name: Testumgebung
2023-10-21 13:52:17 +02:00
if: gitea.repository == 'gcg/schuelerzeitung'
2023-03-26 15:44:45 +02:00
runs-on: act-runner-user
steps:
2024-07-07 12:01:26 +02:00
- name: Pull
2023-10-21 13:52:17 +02:00
run: |
git fetch --all
git reset --hard origin/main
2024-07-07 12:01:26 +02:00
- name: Build
2023-10-21 13:52:17 +02:00
run: |
rm -rf test
2023-10-21 20:25:30 +02:00
hugo --minify --gc --baseURL "https://test.schuelerzeitung-gcg.de/" --buildDrafts --buildFuture -d test
2024-07-07 12:01:26 +02:00
- name: Deploy
2023-03-26 15:44:45 +02:00
run: |
2023-10-21 21:10:05 +02:00
cd test
2024-07-07 12:01:26 +02:00
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung-test/