mirror of
https://codeberg.org/Codeberg-CI/examples.git
synced 2025-09-10 20:35:35 -04:00
'Added Jekyll example with explanation' (#4)
Reviewed-on: https://codeberg.org/Codeberg-CI/examples/pulls/4
This commit is contained in:
commit
ab0c2ce5d7
9
Jekyll/_config.yml
Normal file
9
Jekyll/_config.yml
Normal file
@ -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 ]
|
49
Jekyll/cpages.yml
Normal file
49
Jekyll/cpages.yml
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user