2023-10-21 13:52:17 +02:00
|
|
|
name: schuelerzeitung-prod
|
2023-03-26 15:44:45 +02:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
|
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:
|
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
|
|
|
|
timeout-minutes: 5
|
|
|
|
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/
|
2023-12-30 22:08:16 +01:00
|
|
|
- name: Telegram notification
|
2023-05-28 17:56:31 +02:00
|
|
|
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-01-19 21:18:50 +01:00
|
|
|
- name: Telegram notification
|
|
|
|
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:
|
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
|
|
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
2023-10-21 13:52:17 +02:00
|
|
|
- name: pull
|
|
|
|
run: |
|
|
|
|
git fetch --all
|
|
|
|
git reset --hard origin/main
|
2023-03-26 15:44:45 +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
|
2023-03-26 15:44:45 +02:00
|
|
|
- name: deploy
|
|
|
|
run: |
|
2023-10-21 21:10:05 +02:00
|
|
|
cd test
|
2023-03-26 15:44:45 +02:00
|
|
|
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung-test/
|