web/.forgejo/workflows/publish.yml

45 lines
1.5 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
2024-12-03 22:35:26 +01:00
run: |
apt update
2024-12-03 22:38:05 +01:00
apt install -y pandoc
2024-12-04 12:09:31 +01:00
export DEBIAN_FRONTEND=noninteractive ; apt-get -qq update && apt-get install -y --quiet sshpass rsync
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-04 00:24:14 +01:00
if: ${{ secrets.WEBTOKEN != '' }}
2024-12-03 18:49:19 +01:00
run: |
2024-12-03 18:59:10 +01:00
echo "Cloning"
2024-12-04 00:24:14 +01:00
echo ${{ secrets.WEBTOKEN }}
git clone https://rvba:${{ secrets.RVBA }}@git.forgeons.org/rvba/web
2024-12-03 18:59:10 +01:00
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-05 12:13:39 +01:00
./web.sh convert "$file"
2024-12-03 22:10:57 +01:00
done
2024-12-04 12:06:03 +01:00
2024-12-03 18:49:19 +01:00
cd ..
2024-12-05 12:18:31 +01:00
echo "Rsync"
export DEBIAN_FRONTEND=noninteractive
SSHPASS="${{ secrets.RVBA }}" rsync --rsh='sshpass -e ssh -oStrictHostKeyChecking=no' -av --delete dist/ web@forgeons.org:/home/web/forgeons