schuelerzeitung/.gitea/workflows/prod.yml

52 lines
1.5 KiB
YAML
Raw Normal View History

2023-10-21 13:52:17 +02:00
name: schuelerzeitung-prod
2023-03-26 15:44:45 +02:00
on:
push:
branches:
- main
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-10-21 13:52:17 +02:00
- name: pull
run: |
cd /opt/data/actions/schuelerzeitung-main
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: |
cd /opt/data/actions/schuelerzeitung-main
rm -rf public
2023-10-21 20:25:30 +02:00
hugo --minify --gc --baseURL "https://schuelerzeitung-gcg.de/"
2023-03-26 15:44:45 +02:00
- name: deploy
run: |
2023-10-21 13:52:17 +02:00
cd /opt/data/actions/schuelerzeitung-main/public
2023-03-26 15:44:45 +02:00
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung/
- name: notification
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 }}
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: |
cd /opt/data/actions/schuelerzeitung-main
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: |
cd /opt/data/actions/schuelerzeitung-main
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 13:52:17 +02:00
cd /opt/data/actions/schuelerzeitung-main/test
2023-03-26 15:44:45 +02:00
rsync -azr --delete ./ /opt/data/webdata/schuelerzeitung-test/