.gitea/workflows/prod.yaml aktualisiert

This commit is contained in:
Denys Konovalov 2024-07-05 21:53:54 +02:00
parent af16d26bd9
commit 12c8fd3908

@ -1,11 +1,9 @@
name: website-main name: Website Prod/Test
on: on:
push: push: [master]
branches:
- master
schedule: schedule:
- cron: '0 0 * * *' - cron: '@daily'
defaults: defaults:
run: run:
@ -15,13 +13,12 @@ jobs:
prod-build: prod-build:
if: gitea.repository == 'gcg/gcg-website' if: gitea.repository == 'gcg/gcg-website'
runs-on: act-runner-user runs-on: act-runner-user
timeout-minutes: 5
steps: steps:
- name: pull - name: Pull
run: | run: |
git fetch --all git fetch --all
git reset --hard origin/master git reset --hard origin/master
- name: build - name: Build
run: | run: |
rm -rf public rm -rf public
hugo --minify --gc --baseURL "https://cantorgymnasium.de/" hugo --minify --gc --baseURL "https://cantorgymnasium.de/"
@ -30,7 +27,7 @@ jobs:
cd public cd public
pagefind_extended --site=. pagefind_extended --site=.
rsync -azr --delete ./ /opt/data/webdata/gcg-website/ rsync -azr --delete ./ /opt/data/webdata/gcg-website/
- name: notification - name: Notification
uses: actions/telegram-action@main uses: actions/telegram-action@main
if: always() if: always()
with: with:
@ -39,17 +36,16 @@ jobs:
test-build: test-build:
if: gitea.repository == 'gcg/gcg-website' if: gitea.repository == 'gcg/gcg-website'
runs-on: act-runner-user runs-on: act-runner-user
timeout-minutes: 5
steps: steps:
- name: pull - name: Pull
run: | run: |
git fetch --all git fetch --all
git reset --hard origin/master git reset --hard origin/master
- name: build - name: Build
run: | run: |
rm -rf test rm -rf test
hugo --minify --gc --baseURL "https://test.cantorgymnasium.de/" --buildDrafts --buildFuture -d test hugo --minify --gc --baseURL "https://test.cantorgymnasium.de/" --buildDrafts --buildFuture -d test
- name: deploy - name: Deploy
run: | run: |
cd test cd test
rsync -azr --delete ./ /opt/data/webdata/gcg-website-test/ rsync -azr --delete ./ /opt/data/webdata/gcg-website-test/