2023-03-18 16:51:52 +01:00
|
|
|
name: website-main
|
2023-03-13 21:56:03 +01:00
|
|
|
|
|
|
|
on:
|
2023-03-18 16:54:53 +01:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2023-09-23 13:52:01 +02:00
|
|
|
schedule:
|
2023-09-24 13:27:01 +02:00
|
|
|
- cron: '0 0 * * *'
|
2023-03-18 14:58:36 +01:00
|
|
|
|
|
|
|
concurrency:
|
2023-04-03 12:05:18 +02:00
|
|
|
group: ${{ gitea.workflow }}-${{ gitea.ref }}
|
2023-03-18 14:58:36 +01:00
|
|
|
cancel-in-progress: true
|
2023-03-13 21:56:03 +01:00
|
|
|
|
|
|
|
jobs:
|
2023-03-18 16:51:52 +01:00
|
|
|
prod-build:
|
2023-09-24 13:27:01 +02:00
|
|
|
if: gitea.repository == 'gcg/gcg-website'
|
2023-09-09 16:46:20 +02:00
|
|
|
runs-on: act-runner-user
|
2023-03-18 16:51:52 +01:00
|
|
|
timeout-minutes: 5
|
2023-03-13 21:56:03 +01:00
|
|
|
steps:
|
2023-09-23 15:45:50 +02:00
|
|
|
- name: pull
|
|
|
|
run: |
|
|
|
|
cd /opt/data/actions/gcg-website-master
|
|
|
|
git fetch --all
|
|
|
|
git reset --hard origin/master
|
2023-03-13 21:56:03 +01:00
|
|
|
- name: build
|
2023-09-23 15:48:56 +02:00
|
|
|
run: |
|
|
|
|
cd /opt/data/actions/gcg-website-master
|
2023-09-23 22:49:52 +02:00
|
|
|
rm -rf public
|
2023-09-23 15:48:56 +02:00
|
|
|
hugo --minify --gc --baseURL "https://cantorgymnasium.de/"
|
2023-03-13 21:56:03 +01:00
|
|
|
- name: deploy
|
2023-03-18 14:44:34 +01:00
|
|
|
run: |
|
2023-09-23 15:50:28 +02:00
|
|
|
cd /opt/data/actions/gcg-website-master/public
|
2023-09-23 18:01:28 +02:00
|
|
|
pagefind_extended --site=.
|
2023-03-18 15:01:49 +01:00
|
|
|
rsync -azr --delete ./ /opt/data/webdata/gcg-website/
|
2023-03-13 21:56:03 +01:00
|
|
|
- name: notification
|
2023-04-03 12:05:18 +02:00
|
|
|
uses: actions/telegram-action@main
|
2023-03-13 21:56:03 +01:00
|
|
|
if: always()
|
|
|
|
with:
|
|
|
|
chat_id: ${{ secrets.TG_CHAT_ID }}
|
2023-03-18 16:51:52 +01:00
|
|
|
token: ${{ secrets.TG_TOKEN }}
|
|
|
|
include_commit_info: false
|
|
|
|
test-build:
|
2023-09-24 13:27:01 +02:00
|
|
|
if: gitea.repository == 'gcg/gcg-website'
|
2023-09-09 16:46:20 +02:00
|
|
|
runs-on: act-runner-user
|
2023-03-18 16:51:52 +01:00
|
|
|
timeout-minutes: 5
|
|
|
|
steps:
|
2023-09-23 15:45:50 +02:00
|
|
|
- name: pull
|
|
|
|
run: |
|
|
|
|
cd /opt/data/actions/gcg-website-master
|
|
|
|
git fetch --all
|
|
|
|
git reset --hard origin/master
|
2023-03-18 16:51:52 +01:00
|
|
|
- name: build
|
2023-09-23 15:48:56 +02:00
|
|
|
run: |
|
|
|
|
cd /opt/data/actions/gcg-website-master
|
2023-09-23 22:49:52 +02:00
|
|
|
rm -rf test
|
2023-09-23 15:48:56 +02:00
|
|
|
hugo --minify --gc --baseURL "https://test.cantorgymnasium.de/" --buildDrafts --buildFuture -d test
|
2023-03-18 16:51:52 +01:00
|
|
|
- name: deploy
|
|
|
|
run: |
|
2023-09-23 15:52:59 +02:00
|
|
|
cd /opt/data/actions/gcg-website-master/test
|
2023-03-18 20:41:40 +01:00
|
|
|
rsync -azr --delete ./ /opt/data/webdata/gcg-website-test/
|