web/.forgejo/workflows/publish.yml

33 lines
1 KiB
YAML
Raw Normal View History

2024-12-03 15:26:11 +01:00
on: [push]
jobs:
2024-12-03 18:49:19 +01:00
publish:
runs-on: docker
2024-12-03 15:26:11 +01:00
steps:
- name: Install checkout
uses: https://github.com/actions/checkout@v4
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.
- name: Get changed files
id: changed-files
uses: https://github.com/tj-actions/changed-files@v42
2024-12-03 18:49:19 +01:00
- name: Update website
2024-12-03 15:26:11 +01:00
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
2024-12-03 18:49:19 +01:00
if: ${{ secrets.WEB != '' }}
run: |
git clone --recursive https://rvba:${{ secrets.WEB }}@git.forgeons.org/rvba/web
cd web
git config user.email "ci@git.forgeons.org" ; git config user.name "forgeons-web"
2024-12-03 15:26:11 +01:00
cd scripts
for file in ${ALL_CHANGED_FILES}; do
./web.sh "$file"
2024-12-03 18:49:19 +01:00
cd ..
git add .
if git diff-index --quiet HEAD ; then
echo Nothing changed, not pushing
else
git commit -m 'publish' -a
git push
fi