Mirror to Gitea / mirror (push) Skipped
Astro + React islands + MDX with a theme system (terminal, concrete, nostromo, overgrowth), USMT Dash case study, work/log/sound/models/about/ contact pages, RSS, self-hosted contact form over SMTP, /media proxy to Nextcloud, Dockerfile for Coolify, and a GitHub Action that mirrors main to Gitea.
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
name: Mirror to Gitea
|
|
|
|
# Pushes every commit on main to the Gitea repo as-is (same hashes, authors and
|
|
# dates), which in turn triggers the Coolify deploy.
|
|
#
|
|
# Repo secrets:
|
|
# GITEA_URL - https://gitea.yoyos.sh/yoyos/yoyos.sh.git
|
|
# GITEA_TOKEN - Gitea access token with write:repository
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: mirror-gitea
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
mirror:
|
|
# This file is mirrored too; never run it on Gitea's own runner.
|
|
if: github.server_url == 'https://github.com'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Push main to Gitea
|
|
env:
|
|
GITEA_URL: ${{ secrets.GITEA_URL }}
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
set -euo pipefail
|
|
if [ -z "${GITEA_URL}" ] || [ -z "${GITEA_TOKEN}" ]; then
|
|
echo "::error::GITEA_URL and GITEA_TOKEN secrets must be set"
|
|
exit 1
|
|
fi
|
|
url="${GITEA_URL%/}"
|
|
scheme="${url%%://*}"
|
|
rest="${url#*://}"
|
|
case "$url" in *://*) ;; *) scheme=https; rest="$url" ;; esac
|
|
git push --force "${scheme}://${GITEA_TOKEN}:x-oauth-basic@${rest}" HEAD:refs/heads/main
|