Sync from internal repo: 2025-01-20 22:16:12 #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to Public Repo | |
on: | |
workflow_dispatch: {} | |
push: | |
branches: | |
- master | |
env: | |
GIT_USER_NAME: Mineplex | |
GIT_USER_EMAIL: [email protected] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout private repository code | |
uses: actions/checkout@v4 | |
with: | |
path: 'source' | |
token: ${{ secrets.GH_ACCESS_TOKEN }} | |
fetch-depth: 0 | |
- name: Set up Git user | |
run: | | |
git config --global user.name "${{ env.GIT_USER_NAME }}" | |
git config --global user.email "${{ env.GIT_USER_EMAIL }}" | |
- name: Clone public repository | |
run: | | |
git clone https://github.com/Mineplex-LLC/Studio-PublicDocs.git public | |
cd public | |
git fetch --all | |
git pull origin master | |
cd .. | |
- name: Sync private to public | |
run: | | |
rsync -av --exclude '.git' source/ public/ | |
cd public | |
git add . | |
if [ -n "$(git status --porcelain)" ]; then | |
git commit -m "Sync from internal repo: $(date -u +'%Y-%m-%d %H:%M:%S')" | |
else | |
echo "No changes to commit" | |
fi | |
- name: Push to Public Repo | |
run: | | |
cd public | |
git remote set-url origin https://${{ secrets.GH_ACCESS_TOKEN }}@github.com/Mineplex-LLC/Studio-PublicDocs.git | |
git push origin master |