From 47d1f3ef217ba59afdd28cece12ac406e87b29d9 Mon Sep 17 00:00:00 2001 From: Lee Cattarin Date: Mon, 4 May 2026 11:03:26 -0700 Subject: [PATCH] woodpecker file --- .woodpecker.yml | 59 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .woodpecker.yml diff --git a/.woodpecker.yml b/.woodpecker.yml new file mode 100644 index 0000000..e8cab43 --- /dev/null +++ b/.woodpecker.yml @@ -0,0 +1,59 @@ +# NodeJS / 11ty on Woodpecker to codeberg pages +# +# This file would typically be .woodpecker.yml in the root of your repository. +# +# Takes a repository with 11ty source, generates the static site and +# pushes the result to codeberg pages +# +# +# SECRETS +# https://woodpecker-ci.org/docs/usage/secrets +# CBTOKEN needs a codeberg access token as secret in woodpecker config +# CBEMAIL with email address for git config +# SOURCEREPO must be replaced with the source repo +# DESTREPO must be replaced with the target codeberg pages repo +# CBUSERNAME must be replaced with the user/org +# +# +# We also assume a domains file in the source repo that gets copied to +# .domains in the target repo so codeberg pages works for custom domains + +steps: +- name: build + when: + - branch: pages + event: push + - event: manual + image: node + environment: + CBUSERNAME: inherentlee + SOURCEREPO: fedi-skillshares-src + DESTREPO: fedi-skillshares + CBTOKEN: + from_secret: CBTOKEN + CBEMAIL: + from_secret: CBEMAIL + commands: + # Avoid permission denied errors + - chmod -R a+w . + # Set up git in a working way + - git config --global --add safe.directory /woodpecker/src/codeberg.org/$CBUSERNAME/$SOURCEREPO/_site + - git config --global user.email "$CBEMAIL" + - git config --global user.name "CI Builder" + # clone and move the target repo + - git clone -b pages https://codeberg.org/$CBUSERNAME/$DESTREPO.git _site + - chmod -R a+w _site + - cd _site + # Prepare for push + - git remote set-url origin https://$CBTOKEN@codeberg.org/$CBUSERNAME/$DESTREPO.git + - cd .. + # Run 11ty build stage + - npm install + - npm run build-codeberg + # Only needed for custom domains + #- cp domains _site/.domains + # Push to target + - cd _site + - git add --all + - git commit -m "Woodpecker CI 11ty Build at $( env TZ=America/Chicago date +"%Y-%m-%d %X %Z" )" + - git push -u origin pages