-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (40 loc) · 1.57 KB
/
refresh-wordpress.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
name: 'Refresh WordPress assets'
on:
workflow_dispatch:
# Every day at 8am UTC
schedule:
- cron: '0 8 * * *'
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'
)
runs-on: ubuntu-latest
environment:
name: wordpress-assets
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.ref }}
clean: true
fetch-depth: 0
persist-credentials: false
- uses: ./.github/actions/prepare-playground
- name: 'Recompile WordPress'
shell: bash
run: npx nx recompile-wordpress:all playground-remote
- name: Config git user
run: |
git config --global user.name "deployment_bot"
git config --global user.email "deployment_bot@users.noreply.github.com"
git remote set-url origin https://${{ secrets.GH_ACTOR }}:${{ secrets.GH_TOKEN }}@github.com/${{ github.repository }}
git add -A
git commit -a -m "Recompile WordPress"
git pull --rebase
# Push if the pull did not result in a conflict
if [ $? -eq 0 ]; then
git push origin HEAD:trunk
fi;