diff --git a/Jekyll/_config.yml b/Jekyll/_config.yml new file mode 100644 index 0000000..e733673 --- /dev/null +++ b/Jekyll/_config.yml @@ -0,0 +1,9 @@ +title: My Jekyll Site +url: https://www.myjekyllsite.TLD +description: This is a beautiful page. +remote_theme: pages-themes/cayman@v0.2.0 +plugins: +- jekyll-remote-theme # add this line to the plugins list if you already have one +# The keep_files are needed to preserve git metadata when building +keep_files: [ .domains, LICENSE, .git, .gitignore ] +exclude: [ domains ] \ No newline at end of file diff --git a/Jekyll/cpages.yml b/Jekyll/cpages.yml new file mode 100644 index 0000000..6c135fb --- /dev/null +++ b/Jekyll/cpages.yml @@ -0,0 +1,49 @@ +# cpages.yml +# +# Takes a repository with jekyll source, generates the static site and +# pushes the result to codeberg pages +# +# Needs a codeberg access token (cbtoken) as secret in woodpecker config +# Also uses another secret (cbmail) with email address for git config +# +# CBIN must be replaced with the source repo +# CBOUT must be replaced with the target codeberg pages repo +# CBUSER must be replaced with the user/org +# +# See the _config.yml file for the important keep_files: line to preserve +# git metadata during build +# +# 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 +# +pipeline: + build: + # Use the official jekyll build container + image: jekyll/jekyll + secrets: [ cbtoken, cbmail ] + 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/CBUSER/CBIN/_site + - git config --global user.email "$CBMAIL" + - git config --global user.name "CI Builder" + - git config --global init.defaultBranch pages + # clone and move the taret repo + - git clone -b pages https://codeberg.org/CBUSER/CBOUT.git + - mv CBOUT _site + - chmod -R a+w _site + - cd _site + # Prepare for push + - git remote set-url origin https://$CBTOKEN@codeberg.org/CBUSER/CBOUT.git + - cd .. + # Run Jekyll build stage + - bundle install + - bundle exec jekyll build + # Only needed for custom domains + - cp domains _site/.domains + # Push to target + - cd _site + - git add --all + - git commit -m "Woodpecker CI Jekyll Build" + - git push \ No newline at end of file