From 40aa60fbf36f4e29f394191cafe5efb0909bb9cb Mon Sep 17 00:00:00 2001 From: milovann Date: Tue, 3 Dec 2024 18:49:19 +0100 Subject: [PATCH] workflow --- .forgejo/workflows/{web.yaml => publish.yml} | 25 +++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) rename .forgejo/workflows/{web.yaml => publish.yml} (51%) diff --git a/.forgejo/workflows/web.yaml b/.forgejo/workflows/publish.yml similarity index 51% rename from .forgejo/workflows/web.yaml rename to .forgejo/workflows/publish.yml index 3c2935a..9a3af87 100644 --- a/.forgejo/workflows/web.yaml +++ b/.forgejo/workflows/publish.yml @@ -1,7 +1,7 @@ on: [push] jobs: - automate-ifc: - runs-on: self-hosted + publish: + runs-on: docker steps: - name: Install checkout uses: https://github.com/actions/checkout@v4 @@ -10,16 +10,23 @@ jobs: - name: Get changed files id: changed-files uses: https://github.com/tj-actions/changed-files@v42 - - name: Do computations + - name: Update website env: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - if [[ ! -d web ]] - then - git clone https://git.forgeons.org/rvba/web - fi - cd web && git pull + 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" cd scripts for file in ${ALL_CHANGED_FILES}; do ./web.sh "$file" - + cd .. + git add . + if git diff-index --quiet HEAD ; then + echo Nothing changed, not pushing + else + git commit -m 'publish' -a + git push + fi