From 473a14c50252543466b9a95e39824d04fde8a59d Mon Sep 17 00:00:00 2001 From: daudix-UFO Date: Mon, 18 Dec 2023 21:13:42 +0300 Subject: [PATCH] feat: Update CI --- .woodpecker.yml | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index 08be43b..e6a873c 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -1,5 +1,41 @@ +# Exclude page pipeline to be run on "pages" branch +when: + branch: + exclude: pages + +# Recursive cloning is used to fully clone the themes given as Git submodules +clone: + git: + image: woodpeckerci/plugin-git + settings: + recursive: true + steps: + # Build Zola static files build: - image: fish + image: ghcr.io/getzola/zola:v0.17.2 commands: - - zola build --output-dir /srv/http/pages/duckquill --force + - zola build + when: + event: [ pull_request, push ] + + publish: + image: bitnami/git + # Must be set in Woodpecker configuration + secrets: [ mail, codeberg_token ] + environment: + - ZOLA_OUTPUT=public + commands: + # Git configuration + - git config --global user.email $MAIL + - git config --global user.name "Woodpecker CI" + - git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME + # Copy build step output to repository folder + - cp -ar $ZOLA_OUTPUT/. $CI_REPO_NAME/ + # Commit and push all static files with pipeline started timestamp + - cd $CI_REPO_NAME + - git add . + - git commit -m "Woodpecker CI ${CI_BUILD_CREATED}" + - git push + when: + event: push