mirror of
https://codeberg.org/Codeberg-CI/examples.git
synced 2025-09-11 21:04:58 -04:00
Revert "use appleboy/drone-git-push for best practice"
This reverts commit 4e61709ac39d864d25abd4197563ff9bf9bac0ef.
This commit is contained in:
parent
4e61709ac3
commit
108c3eb7b2
@ -5,61 +5,55 @@
|
|||||||
# Takes a repository with jekyll source, generates the static site and
|
# Takes a repository with jekyll source, generates the static site and
|
||||||
# pushes the result to codeberg pages
|
# pushes the result to codeberg pages
|
||||||
#
|
#
|
||||||
# Needs a ssh key as secret in woodpecker config
|
# 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
|
# See the _config.yml file for the important keep_files: line to preserve
|
||||||
# git metadata during build
|
# git metadata during build
|
||||||
#
|
#
|
||||||
# We also assume a domains file in the source repo that gets copied to
|
# 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
|
# .domains in the target repo so codeberg pages works for custom domains
|
||||||
# for more information, https://docs.codeberg.org/codeberg-pages/
|
#
|
||||||
|
|
||||||
when:
|
|
||||||
branch: main
|
|
||||||
event: [push, pull_request]
|
|
||||||
|
|
||||||
clone:
|
|
||||||
- name: clone
|
|
||||||
image: docker.io/woodpeckerci/plugin-git
|
|
||||||
# clone the static page repository
|
|
||||||
- name: clone-page
|
|
||||||
image: docker.io/woodpeckerci/plugin-git
|
|
||||||
settings:
|
|
||||||
partial: false
|
|
||||||
remote: https://codeberg.org/Colgrave/<YOUR_PAGE_REPO>.git
|
|
||||||
path: _site
|
|
||||||
# clone the pages branch
|
|
||||||
# - name: clone-page
|
|
||||||
# image: woodpeckerci/plugin-git
|
|
||||||
# settings:
|
|
||||||
# branch: pages
|
|
||||||
# partial: false
|
|
||||||
# path: _site
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build
|
build:
|
||||||
image: docker.io/bretfisher/jekyll:latest
|
when:
|
||||||
|
event: [push, pull_request]
|
||||||
|
# Use the official jekyll build container
|
||||||
|
image: jekyll/jekyll
|
||||||
|
environment:
|
||||||
|
# secrets must be set in Woodpecker configuration
|
||||||
|
CBMAIL:
|
||||||
|
from_secret: cbmail
|
||||||
|
CBTOKEN:
|
||||||
|
from_secret: cbtoken
|
||||||
commands:
|
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 target 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
|
# Run Jekyll build stage
|
||||||
- bundle install
|
- bundle install
|
||||||
- bundle exec jekyll build
|
- bundle exec jekyll build
|
||||||
# Only needed for custom domains
|
# Only needed for custom domains
|
||||||
# - cp .domains _site/.domains
|
- cp domains _site/.domains
|
||||||
|
# Push to target
|
||||||
- name: push
|
- cd _site
|
||||||
# for more information about plugin settings, please refer to
|
- git add --all
|
||||||
# https://github.com/appleboy/drone-git-push/blob/master/DOCS.md
|
- git commit -m "Woodpecker CI Jekyll Build at $( env TZ=Europe/Berlin date +"%Y-%m-%d %X %Z" ) [SKIP CI]"
|
||||||
image: docker.io/appleboy/drone-git-push:latest
|
- git push
|
||||||
settings:
|
|
||||||
ssh_key:
|
|
||||||
from_secret: codeberg_ssh
|
|
||||||
# push to your static page repository, change it to your need
|
|
||||||
remote: git@codeberg.org:Colgrave/pages.git
|
|
||||||
# if you are using a branch rather than a repo, change `remote` setting
|
|
||||||
# and change `branch` to `pages`
|
|
||||||
branch: main
|
|
||||||
path: _site
|
|
||||||
commit: true
|
|
||||||
# force: boolean, force push using the `--force` flag, defaults to false
|
|
||||||
# commit_message: add a custom message for commit, if it is omitted, it will be `[skip ci] Commit dirty state`
|
|
||||||
# empty_commit: boolean, if you only want generate an empty commit, you can do it using this option
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user