-
Notifications
You must be signed in to change notification settings - Fork 29
47 lines (45 loc) · 1.7 KB
/
postprocess.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Post-process Blueprints after changes
on:
push:
branches:
- trunk
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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/[email protected]
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 "[email protected]"
git add -A
git commit -a -m "Reindex and reformat Blueprints"
git pull --rebase
if [ $? -eq 0 ]; then
git push [email protected]:${{ github.repository }}.git --follow-tags
fi;