agmission/.gitea/workflows/sync-to-svn.yaml
Devin Major 4d39ac2595
All checks were successful
Sync to SVN / push-to-svn (push) Successful in 28s
try adding on: push to start the action
2026-04-22 15:48:25 -04:00

54 lines
2.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Gitea Actions Sync git repository to SVN
# Equivalent of .circleci/config.yml, translated to GitHub Actions syntax
# which Gitea Actions supports natively.
#
# Prerequisites (set as repository Secrets in Gitea → Settings → Secrets):
# SVN_USERNAME SVN commit username
# SVN_PASSWORD SVN commit password
# SVN_REPO_URL Base SVN repo URL (e.g. https://svn.example.com/repos/myproject)
name: Sync to SVN
on: [push]
jobs:
push-to-svn:
runs-on: self-hosted
steps:
- name: Checkout git repository
uses: actions/checkout@v4
# SVN and rsync are pre-installed in the container image, but the
# apt-get call is kept so the workflow works on a stock runner too.
- name: Install SVN and rsync
run: |
if ! command -v svn &>/dev/null || ! command -v rsync &>/dev/null; then
sudo apt-get update -qq && sudo apt-get install -y subversion rsync
fi
- name: Verify SVN credentials are set
run: |
if [ -z "${{ secrets.SVN_USERNAME }}" ]; then echo "ERROR: SVN_USERNAME secret is not set" && exit 1; fi
if [ -z "${{ secrets.SVN_PASSWORD }}" ]; then echo "ERROR: SVN_PASSWORD secret is not set" && exit 1; fi
if [ -z "${{ secrets.SVN_REPO_URL }}" ]; then echo "ERROR: SVN_REPO_URL secret is not set" && exit 1; fi
echo "All SVN secrets are set."
- name: Checkout SVN branch
run: |
svn checkout \
--username "${{ secrets.SVN_USERNAME }}" \
--password "${{ secrets.SVN_PASSWORD }}" \
--no-auth-cache \
--non-interactive \
--trust-server-cert \
"${{ secrets.SVN_REPO_URL }}/branches/data-export-api-copy" svn-branch
- name: Sync files to SVN working copy
run: |
rsync -a --delete \
--exclude='.git/' \
--exclude='.gitea/' \
--exclude='.svn/' \
--exclude='svn-branch/' \
. svn-branch/