Push to web when public branch updated, add script to create a doc version
All checks were successful
Build and Deploy MkDocs / build-next (push) Successful in 2m14s

This commit is contained in:
Skylar Ittner 2026-02-28 18:43:43 -07:00
parent 5f103b6102
commit c0f363b788
3 changed files with 64 additions and 13 deletions

View File

@ -49,16 +49,3 @@ jobs:
run: | run: |
mike set-default next mike set-default next
mike deploy --push --update-aliases next latest 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

View File

@ -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

11
publish_version.sh Normal file
View File

@ -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