🪞 Mirror to Codeberg workflow (lissy93/portainer-templates)
The 🪞 Mirror to Codeberg workflow from lissy93/portainer-templates, explained and optimized by Latchkey.
A
CI health: A - excellent
Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.
What it does
This is the 🪞 Mirror to Codeberg workflow from the lissy93/portainer-templates repository, a real project running GitHub Actions. It is shown here with attribution under its MIT license.
Below, Latchkey shows a faster, safer version produced by its optimization engine.
The workflow
workflow (.yml)
# Pushes the contents of the repo to the Codeberg mirror
name: 🪞 Mirror to Codeberg
on:
workflow_dispatch:
schedule:
- cron: '30 2 * * 0' # At 02:30 on Sunday
# Read-only; the mirror auths over SSH
permissions:
contents: read
jobs:
codeberg:
runs-on: ubuntu-latest
steps:
- name: Checkout (full history)
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
# Mirror all branches and tags
fetch-depth: 0
persist-credentials: false
- name: Mirror to Codeberg
uses: pixta-dev/repository-mirroring-action@674e65a7d483ca28dafaacba0d07351bdcc8bd75 # v1.1.1
with:
target_repo_url: git@codeberg.org:alicia/portainer-templates.git
ssh_private_key: ${{ secrets.CODEBERG_SSH }}
The same workflow, on Latchkey
Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.
# Pushes the contents of the repo to the Codeberg mirror name: 🪞 Mirror to Codeberg on: workflow_dispatch: schedule: - cron: '30 2 * * 0' # At 02:30 on Sunday # Read-only; the mirror auths over SSH permissions: contents: read jobs: codeberg: timeout-minutes: 30 runs-on: latchkey-small steps: - name: Checkout (full history) uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 with: # Mirror all branches and tags fetch-depth: 0 persist-credentials: false - name: Mirror to Codeberg uses: pixta-dev/repository-mirroring-action@674e65a7d483ca28dafaacba0d07351bdcc8bd75 # v1.1.1 with: target_repo_url: git@codeberg.org:alicia/portainer-templates.git ssh_private_key: ${{ secrets.CODEBERG_SSH }}
What changed
- Run on Latchkey managed runners with one line (
runs-on), which apply the fixes below automatically and self-heal transient failures. This example useslatchkey-small; pick the runner size that fits the job. - Add a job timeout so a hung step cannot burn hours of runner time.
This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.