schuelerzeitung/.gitea/workflows/prod.yml
Denys Konovalov 80d7a7ef0d
All checks were successful
schuelerzeitung-prod / prod-build (push) Successful in 5s
schuelerzeitung-prod / test-build (push) Successful in 2s
.gitea/workflows/prod.yml aktualisiert
2024-01-19 21:18:50 +01:00

59 lines
1.5 KiB
YAML

name: schuelerzeitung-prod
on:
push:
branches:
- main
defaults:
run:
working-directory: /opt/runner/workdir/schuelerzeitung-main
jobs:
prod-build:
if: gitea.repository == 'gcg/schuelerzeitung'
runs-on: act-runner-user
timeout-minutes: 5
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: Telegram notification
uses: actions/telegram-action@main
if: always()
with:
chat_id: ${{ secrets.TG_CHAT_ID }}
token: ${{ secrets.TG_TOKEN }}
- name: Telegram notification
uses: actions/telegram-action@main
if: always()
with:
chat_id: ${{ secrets.SZ_CHAT_ID }}
token: ${{ secrets.TG_TOKEN }}
test-build:
if: gitea.repository == 'gcg/schuelerzeitung'
runs-on: act-runner-user
timeout-minutes: 5
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/