From 93db7e7bcd4f772cf94252442a94be5daa856c90 Mon Sep 17 00:00:00 2001 From: daudix Date: Thu, 4 Jul 2024 21:47:49 +0300 Subject: [PATCH] Remove the .domains copy step from CI Zola can copy static files to the site root by itself --- .woodpecker.yaml | 26 +++++++++++++------------- .domains => static/.domains | 1 - 2 files changed, 13 insertions(+), 14 deletions(-) rename .domains => static/.domains (58%) diff --git a/.woodpecker.yaml b/.woodpecker.yaml index 1ad69d1..507f08e 100644 --- a/.woodpecker.yaml +++ b/.woodpecker.yaml @@ -1,9 +1,9 @@ -# Exclude page pipeline to be run on "pages" branch +# Exclude the pipeline to run on the pages branch when: branch: exclude: pages -# Recursive cloning is used to fully clone the themes given as Git submodules +# Clone recursively to fully clone the themes given as Git submodules clone: git: image: woodpeckerci/plugin-git @@ -11,7 +11,7 @@ clone: recursive: true steps: - # Build zola static files + # Build Zola static files build: image: alpine:edge commands: @@ -24,24 +24,24 @@ steps: publish: image: bitnami/git # Must be set in Woodpecker configuration + # mail: Your email address used by Codebrg + # codeberg_token: Codeberg access token with "write:repository" permission secrets: [mail, codeberg_token] commands: - # Git configuration + # Configure Git - git config --global user.email $MAIL - git config --global user.name "Woodpecker CI" - # Clone output branch - - git clone -b pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME - # Enter output branch folder + # Clone the output branch + - git clone --branch pages https://$CODEBERG_TOKEN@codeberg.org/$CI_REPO.git $CI_REPO_NAME + # Enter the output branch - cd $CI_REPO_NAME # Remove old files - - git rm -r "*" || true # Ignore if it's empty - # Copy build step output + - git rm -r "*" || true # Don't fail if there's nothing to remove + # Copy the output of the build step - cp -ar ../public/. . - # Needed for custom domains - - cp ../.domains . || true # Ignore if it doesn't exist - # Commit and push all static files with source commit SHA + # Commit and push all static files with the source commit hash - git add --all - - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" || true + - git commit -m "Woodpecker CI ${CI_COMMIT_SHA} [SKIP CI]" --allow-empty - git push when: event: [push, manual] diff --git a/.domains b/static/.domains similarity index 58% rename from .domains rename to static/.domains index c5c1b5d..95bdcf5 100644 --- a/.domains +++ b/static/.domains @@ -1,3 +1,2 @@ duckquill.daudix.one duckquill.daudix.codeberg.page -pages.duckquill.daudix.codeberg.page