adnan360 a3ec5e3d86 Update instructions for Drone 3 years ago
..
.drone.yml 21892c6eb1 Fix indentation 3 years ago
README.md a3ec5e3d86 Update instructions for Drone 3 years ago

README.md

Drone git push setup for Codeberg.org

Drone CI yaml example on how to push to git repo after build is done.

In my case I created the key with something like: ssh-keygen -m PEM -t rsa -P "" -C "your_email@example.com" -f ~/.ssh/id_john_codeberg. Otherwise drone-git-push fails to push.

Instructions

Setup a Drone CI instance on any computer in the world, without VPS or domains! Or use any existing instance you have.

Run ssh-keygen -m PEM -t rsa -P "" -C "your_email@example.com" -f ~/.ssh/id_john_codeberg.

Login to Codeberg, (Avatar) - Settings - SSH/GPG Keys - Add Key. Paste in the output of cat ~/.ssh/id_john_codeberg.pub and click Add Key.

Open Drone CI UI URL, make sure to activate the repo. Go inside repo - Settings - Secrets - New Secret. Create a new secret with name as ssh_key and put cat ~/.ssh/id_john_codeberg | awk '{printf "%s\\n", $0}' as value. The awk call is for replacing new lines with literal \n as this issue suggests.

Now commit the .drone.yml file from this directory in the repo root (change the placeholder values) and it should run the build process. It will run the build and (if there is a change in output) it will commit the changes automatically with commit message Drone build (some hash).

Placeholder values

johndoe456 is codeberg.org username, pages.git is the repo. author_name and author_email are related to commit.