Did you create a pipeline that you'd like to share? Something you are proud of? Or just a repo that others could take a look at for inspiration?
Share your pipelines here with a link to the project where they are used in.
Did you create a pipeline that you'd like to share? Something you are proud of? Or just a repo that others could take a look at for inspiration?
Share your pipelines here with a link to the project where they are used in.
Yesterday, I was able to setup a pipeline to:
The pipeline:
on:push:tags:- 'v*'jobs:energize-build-web:runs-on:codeberg-small-lazysteps:- name:Checkout App to 'epinez/Energize/Energize'uses:https://code.forgejo.org/actions/checkout@v4with:path:Energizesubmodules:recursivefetch-depth:0- name:Flutter Setuprun:| cd Energize
sed -i "/'tar', '-xzf'/s/'-xzf'/'--no-same-owner', '-xzf'/" submodules/flutter/packages/flutter_tools/lib/src/base/os.dart
submodules/flutter/bin/flutter config --no-analytics - name:Flutter Prebuildrun:| cd Energize
submodules/flutter/bin/flutter pub get
submodules/flutter/bin/dart run build_runner build --delete-conflicting-outputs - name:Flutter Build Webrun:| cd Energize
submodules/flutter/bin/flutter build web --release --base-href "/projects/energize/" - name:Checkout Pages to 'epinez/Energize/pages'uses:https://code.forgejo.org/actions/checkout@v4with:repository:epinez/pagesref:mainpath:pagesssh-key:${{ secrets.SSH_PUSH_KEY }}ssh-known-hosts:${{ secrets.CI_KNOWN_HOSTS }}- name:Deploy Energize to Codeberg Pagesrun:| rm -r pages/projects/energize/*
cp -r Energize/build/web/* pages/projects/energize/
git -C pages config user.name "forgejo-actions[bot]"
git -C pages config user.email "epinez@noreply.codeberg.org"
git -C pages add projects/energize
git -C pages commit -m "Deploy current Energize version"
git -C pages pushIt is only mandatory to:
Works flawless so far. 🙂
Here is my simple pipeline for python using UV for dependencies and RUFF for lint/format:
name:Pythonon:workflow_dispatch:pull_request:types:[labeled]jobs:test:name:Testif:github.event_name == 'workflow_dispatch' || github.event.label.name == 'trigger_pipeline'runs-on:codeberg-tiny-lazycontainer:image:ghcr.io/catthehacker/ubuntu:act-lateststeps:- uses:https://code.forgejo.org/actions/checkout@v4with:fetch-depth:1- name:Install uvrun:pip install uv- name:Ruff checkrun:uvx ruff check .- name:Install the projectrun:uv sync --all-extras --dev- name:Run testsrun:uv run python -m unittest discover testsAnd a second pipeline to publish your package to pipy again, using uv (using a pypi token saved in the secret named PYPI_TOKEN):
name:Publish Pypion:workflow_dispatch:push:tags:- "*"jobs:publish:name:Publishruns-on:codeberg-tiny-lazycontainer:image:ghcr.io/catthehacker/ubuntu:act-lateststeps:- uses:https://code.forgejo.org/actions/checkout@v4with:fetch-depth:1- name:Install uvrun:pip install uv- name:Publishrun:| uv build
uv publish --token ${{ secrets.PYPI_TOKEN }}
I also have a workflow that publishes as Codeberg Pages using Lektor:
on:
push:
branches:
- 'main'
jobs:
deploy:
runs-on: codeberg-tiny-lazy
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
with:
path: build
- uses: https://code.forgejo.org/actions/checkout@v4
with:
ref: 'pages'
path: deploy
- uses: https://code.forgejo.org/actions/setup-python@v5
with:
python-version: 3.12
- run: pip install -r build/requirements.txt
- run: cd build && lektor build
- run: |
set -e
cd deploy
rm -r *
cp -r ../build/dist/* .
git config user.name "forgejo-action[bot]"
git config user.email "<your-username>@noreply.codeberg.org"
git add -A
git commit --allow-empty -m "Auto-commit by Action #$GITHUB_RUN_NUMBER" -m "Build from $GITHUB_SHA"
git push
The difference to @epinez approach is that both the source code and the final page are in the same repo as different branches ('main' and 'pages').
Thank you for providing this service! Once I found this repository, the workflow was straightforward to set up.
Hello,
I succeded with the following actions file:
on:[push]jobs:check-format:runs-on:codeberg-tiny-lazysteps:# Check out the repository.- uses:https://code.forgejo.org/actions/checkout@v4# Install stylua.- run:wget "https://github.com/JohnnyMorganz/StyLua/releases/latest/download/stylua-linux-x86_64.zip"- run:unzip stylua-linux-x86_64.zip- run:chmod a+x stylua# Check styling.- run:./stylua --check ftplugin/ lua/I could not run this action using an alpine image as checkout failed due to a missing node installation. Thus, I used the default image and manually installed stylua (stylua is present in the alpine repositories).
Thanks to all people involved in this and for making this possible!
I took on the challenge to see if I could run my library tests on all the 8 supported versions of Python in under 2 minutes on a regular tiny instance.
I at first optimised it too much as it turns out one needs nodejs:20 to do the checkout actions.
Eventually I settled on the default node:20 debian base image, and then installed uv and used it to install all the python versions and ran the tests using tox.
This is what I ended up with that works for me, it consistently runs in under 1 minute 😄:
name:Run testson:workflow_dispatch:pull_request:push:branches:- 'main'jobs:test:name:Testsruns-on:codeberg-tinysteps:- uses:https://code.forgejo.org/actions/checkout@v4with:fetch-depth:1- name:Install all python versionsrun:| curl -LsSf https://astral.sh/uv/install.sh | sh
ln -s /root/.local/bin/uv /usr/local/bin/uv
uv python install --no-progress cpython-3.14 cpython-3.13 cpython-3.12 cpython-3.11 cpython-3.10 cpython-3.9 cpython-3.8 pypy-3.11
uv pip install --system tox tox-uv- name:Run toxrun:tox r --result-json result.jsonI'm not 100% happy using remote-code execution to install uv and then use their build artefacts. I'd rather use a public docker image that has node and all the python versions installed so the runner can cache more effectively.
Thanks for the hints I found here to make this work!
I have now a latex pipeline that I run on a self-hosted forgejo instance:
name:Compile docson:workflow_dispatch:pull_request:types:[labeled]jobs:test:name:Latex documentif:github.event_name == 'workflow_dispatch' || github.event.label.name == 'trigger_pipeline'runs-on:codeberg-tinycontainer:image:registry.gitlab.com/islandoftex/images/texlive:lateststeps:- run:apt update && apt install -y nodejs- uses:https://code.forgejo.org/actions/checkout@v4with:fetch-depth:1- name:Compile CVrun:lualatex a_document.tex It uses a latex docker image and install node on it to be able to use the checkout action
on:push:branches:- mainjobs:pdflatex:runs-on:codeberg-tiny-lazycontainer:image:ghcr.io/xu-cheng/texlive-alpine-small:lateststeps:- run:apk update && apk add nodejs git-lfs # needed for checkout- uses:https://data.forgejo.org/actions/checkout@v4with:lfs:true# needed for included images stored with Git-LFS- run:tlmgr install cleveref # needed for extra packages, e.g. cleveref- run:pdflatex document.tex && pdflatex document.tex- uses:https://data.forgejo.org/forgejo/upload-artifact@v4with:name:document.pdfpath:document.pdfcompression-level:0# no compressionAnd here, a very simple pipeline to synchronize a master branch with the development branch main (it works flawlessly for many of my repositories, e.g. in /spiky):
on:push:branches:- mainjobs:sync:runs-on:codeberg-tinysteps:- name:checkout mainuses:actions/checkout@v4- name:push to masterrun:git push --force origin main:masterI've set up self hosted Actions and used it to port my deploy to PyPI off Github
name:Publish Packageon:# to *test* this, temporarily enable test.pypi.org (below) and trigger the# build by making a tag at https://codeberg.org/kousu/radicale-bsdauth/releases/new# pointed at the branch under test. It has to be a valid version string, but# you can mark it with ".dev" to keep it out of the way: increment the most recent published version# e.g. v2.3.2 -> v2.3.3.dev1, then v2.3.3.dev2, v2.3.3.dev3 etc.# Also consider enabling test.pypi.org below.release:types:[published]jobs:publish:name:Publish Packageruns-on:ubuntu-lateststeps:- name:Install CI Tools# on my self-hosted runner, the runner image is missing these tools.run:| DEBIAN_FRONTEND=noninteractive apt update
DEBIAN_FRONTEND=noninteractive apt install -y nodejs jq curl wget- uses:actions/checkout@v3- uses:actions/setup-python@v3- name:Install dependenciesrun:| pip install build- name:Buildrun:python -m build- name:Publish Releaseuses:actions/forgejo-release@v2with:direction:uploadoverride:truerelease-dir:dist/sha256sum:truetoken:${{ secrets.FORGEJO_TOKEN }}- name:Publish to PyPIif:secrets.PYPI_TOKEN != ''uses:https://github.com/pypa/gh-action-pypi-publish@release/v1with:user:__token__password:${{ secrets.PYPI_TOKEN }}# TESTING:# repository-url: https://test.pypi.org/legacy/# password: ${{ secrets.TEST_PYPI_TOKEN }}This published straight to https://test.pypi.org/project/radicale-bsdauth/1.0.2.dev6/ and to https://codeberg.org/kousu/radicale-bsdauth/releases/tag/v1.0.2.dev6. The next time I actually have cause to make a release it will go to https://pypi.org/project/radicale-bsdauth/1.0.2 and https://codeberg.org/kousu/radicale-bsdauth/releases/tag/v1.0.2.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?