From c0f363b788f80abd5a5954a7058c8754d2d0a7d1 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 28 Feb 2026 18:43:43 -0700 Subject: [PATCH] Push to web when public branch updated, add script to create a doc version --- .gitea/workflows/deploy.yml | 13 -------- .gitea/workflows/publishpublic.yml | 53 ++++++++++++++++++++++++++++++ publish_version.sh | 11 +++++++ 3 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 .gitea/workflows/publishpublic.yml create mode 100644 publish_version.sh diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index a93be79..574e64a 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -49,16 +49,3 @@ jobs: run: | mike set-default next mike deploy --push --update-aliases next latest - - - name: Checkout public branch - run: | - git checkout public - - - name: Deploy with rsync - run: | - rsync -rltz --no-perms --no-owner --no-group --omit-dir-times --delete \ - --filter='P error/' \ - --filter='P stats/' \ - --exclude=".git/" \ - ./ \ - ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/var/www/dev.postalpoint.app/web diff --git a/.gitea/workflows/publishpublic.yml b/.gitea/workflows/publishpublic.yml new file mode 100644 index 0000000..ffad45f --- /dev/null +++ b/.gitea/workflows/publishpublic.yml @@ -0,0 +1,53 @@ +name: Push public branch to HTTP server + +on: + push: + branches: + - public + +jobs: + build-next: + runs-on: ubuntu-latest + + steps: + - name: Set up container + run: | + apt update + apt install -y rsync + + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Setup SSH keys + run: | + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + ssh-keyscan ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts + ssh-keyscan -p 2322 source.netsyms.com >> ~/.ssh/known_hosts + + - name: Configure Git + run: | + git config user.name "CI" + git config user.email "ci@netsyms.com" + git remote set-url origin ssh://gitea@source.netsyms.com:2322/PostalPortal/PostalPoint_Plugins.git + + - name: Checkout public branch + run: | + git checkout public + + - name: Deploy with rsync + run: | + rsync -rltz --no-perms --no-owner --no-group --omit-dir-times --delete \ + --filter='P error/' \ + --filter='P stats/' \ + --exclude=".git/" \ + ./ \ + ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:/var/www/dev.postalpoint.app/web diff --git a/publish_version.sh b/publish_version.sh new file mode 100644 index 0000000..d674c1c --- /dev/null +++ b/publish_version.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +echo "Switching to public branch, force-syncing with upstream, publishing version $1, and pushing to upstream" +git checkout public +git reset --hard origin/public +git pull +git checkout master +mike deploy $1 +git checkout public +git push +git checkout master