51 lines
1.8 KiB
YAML
51 lines
1.8 KiB
YAML
name: Post-process Blueprints after changes
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- trunk
|
|
|
|
jobs:
|
|
build:
|
|
if: ${{ github.actor != 'deployment_bot' }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Set up Python 3.8
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: 3.8
|
|
- name: Install Prettier
|
|
run: npm install -g prettier
|
|
- name: Run reindex_postprocess.py
|
|
run: python reindex_postprocess.py
|
|
- name: Run Prettier
|
|
run: prettier --write blueprints/**/*.json
|
|
- name: Check for uncommitted changes
|
|
id: changes
|
|
run: |
|
|
if [ -z "$(git status --porcelain)" ]; then
|
|
echo "No changes"
|
|
echo 'CHANGES=0' >> $GITHUB_OUTPUT
|
|
else
|
|
echo "Changes detected"
|
|
echo 'CHANGES=1' >> $GITHUB_OUTPUT
|
|
fi
|
|
- name: Setup SSH Keys
|
|
uses: webfactory/ssh-agent@v0.5.3
|
|
with:
|
|
ssh-private-key: ${{ secrets.GH_DEPLOY_KEY }}
|
|
- name: Push rebuilt WordPress to GitHub
|
|
if: steps.changes.outputs.CHANGES == '1'
|
|
run: |
|
|
git config --global user.name "deployment_bot"
|
|
git config --global user.email "deployment_bot@users.noreply.github.com"
|
|
git add -A
|
|
git commit -a -m "Reindex and reformat Blueprints"
|
|
git pull --rebase
|
|
if [ $? -eq 0 ]; then
|
|
git push git@github.com:${{ github.repository }}.git --follow-tags
|
|
fi;
|
|
|