web/.forgejo/workflows/publish.yml

44 lines
1.3 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:
2024-12-03 22:27:07 +01:00
- name: Install Pandoc
run: apt install pandoc
2024-12-03 15:26:11 +01:00
- 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
2024-12-03 18:59:10 +01:00
uses: https://github.com/tj-actions/changed-files@v45
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 }}
2024-12-03 18:49:19 +01:00
if: ${{ secrets.WEB != '' }}
run: |
2024-12-03 18:59:10 +01:00
echo "Cloning"
git clone https://rvba:${{ secrets.WEB }}@git.forgeons.org/rvba/web
echo "Cd"
2024-12-03 18:49:19 +01:00
cd web
2024-12-03 18:59:10 +01:00
echo "Config"
2024-12-03 22:05:00 +01:00
git config user.email "ci@git.forgeons.org"
git config user.name "forgeons-web"
2024-12-03 22:07:16 +01:00
cd scripts
2024-12-03 22:08:21 +01:00
ls -al
2024-12-03 22:05:00 +01:00
echo "Pandoc"
./install.sh
echo "Script"
2024-12-03 15:26:11 +01:00
for file in ${ALL_CHANGED_FILES}; do
2024-12-03 22:10:57 +01:00
echo "Script"
2024-12-03 15:26:11 +01:00
./web.sh "$file"
2024-12-03 22:10:57 +01:00
done
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