-
Notifications
You must be signed in to change notification settings - Fork 260
64 lines (61 loc) · 2.46 KB
/
refresh-sqlite-integration.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: 'Refresh SQLite plugin'
on:
workflow_dispatch:
# Every 20 minutes
schedule:
- cron: '0 9 * * *'
jobs:
build_and_deploy:
# Only run this workflow from the trunk branch and when it's triggered by dmsnell OR adamziel
if: >
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
github.actor == 'bgrgicak' ||
github.actor == 'brandonpayton'
)
runs-on: ubuntu-latest
environment:
name: wordpress-assets
concurrency:
group: check-version-and-run-build
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
clean: true
persist-credentials: false
submodules: true
- uses: ./.github/actions/prepare-playground
- name: 'Refresh the SQLite bundle'
shell: bash
run: npx nx bundle-sqlite-database playground-wordpress-builds
- 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: Push changes to GitHub
if: steps.changes.outputs.CHANGES == '1'
run: |
git config --global user.name "deployment_bot"
git config --global user.email "[email protected]"
git remote set-url origin https://${{ secrets.GH_ACTOR }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
git add -A
git commit -a -m "Refresh SQLite integration plugin"
git pull --rebase
# Push if the pull did not result in a conflict
if [ $? -eq 0 ]; then
git push origin HEAD:trunk
fi;
- name: Deploy website
if: steps.changes.outputs.CHANGES == '1'
uses: benc-uk/workflow-dispatch@v1
with:
workflow: build-website.yml
token: ${{ secrets.GITHUB_TOKEN }}