schuelerzeitung/.gitea/workflows/prod.yml

52 lines
1.5 KiB
YAML

name: schuelerzeitung-prod
on:
push:
branches:
- main
jobs:
prod-build:
if: gitea.repository == 'gcg/schuelerzeitung'
runs-on: act-runner-user
timeout-minutes: 5
steps:
- name: pull
run: |
cd /opt/data/actions/schuelerzeitung-main
git fetch --all
git reset --hard origin/main
- name: build
run: |
cd /opt/data/actions/schuelerzeitung-main
rm -rf public
hugo --minify --gc --baseURL "https://schuelerzeitung-gcg.de/"
- name: deploy
run: |
cd /opt/data/actions/schuelerzeitung-main/public
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung/
- name: notification
uses: actions/telegram-action@main
if: always()
with:
chat_id: ${{ secrets.TG_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: |
cd /opt/data/actions/schuelerzeitung-main
git fetch --all
git reset --hard origin/main
- name: build
run: |
cd /opt/data/actions/schuelerzeitung-main
rm -rf test
hugo --minify --gc --baseURL "https://test.schuelerzeitung-gcg.de/" --buildDrafts --buildFuture -d test
- name: deploy
run: |
cd /opt/data/actions/schuelerzeitung-main/test
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung-test/