From 3cfb81adfedc7f056b4274e91ec238847620c936 Mon Sep 17 00:00:00 2001 From: Devin Major Date: Wed, 22 Apr 2026 15:30:30 -0400 Subject: [PATCH] initialize the CI/CD pipeline to sync to SVN (does not include the commit step yet) --- .gitea/config.yml | 57 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .gitea/config.yml diff --git a/.gitea/config.yml b/.gitea/config.yml new file mode 100644 index 0000000..9019a4c --- /dev/null +++ b/.gitea/config.yml @@ -0,0 +1,57 @@ +# 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: + branches: + - master + +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/