commit 8891d9e227d74370a1a75262d09435d67f584f68 Author: milovann Date: Thu Dec 5 12:34:55 2024 +0100 Initial commit diff --git a/default.yml b/default.yml new file mode 100644 index 0000000..899022c --- /dev/null +++ b/default.yml @@ -0,0 +1,6 @@ +on: [push] +jobs: + test: + runs-on: docker + steps: + - run: echo Hello, Runner ! \ No newline at end of file diff --git a/git.yml b/git.yml new file mode 100644 index 0000000..b4eceb3 --- /dev/null +++ b/git.yml @@ -0,0 +1,49 @@ +on: [push] +jobs: + publish: + runs-on: docker + steps: + - name: Install Pandoc + run: | + apt update + apt install -y pandoc + export DEBIAN_FRONTEND=noninteractive ; apt-get -qq update && apt-get install -y --quiet sshpass rsync + - 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@v45 + - name: Update website + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + if: ${{ secrets.WEBTOKEN != '' }} + run: | + echo "Cloning" + echo ${{ secrets.WEBTOKEN }} + git clone https://rvba:${{ secrets.RVBA }}@git.forgeons.org/rvba/web + echo "Cd" + cd web + echo "Config" + git config user.email "ci@git.forgeons.org" + git config user.name "forgeons-web" + cd scripts + ls -al + echo "Pandoc" + ./install.sh + echo "Script" + for file in ${ALL_CHANGED_FILES}; do + echo "Script" + ./web.sh convert "$file" + done + + cd .. + git add . + if git diff-index --quiet HEAD ; then + echo "Nothing changed, not pushing" + else + 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 + fi