Skip to content

Refresh WordPress Nightly #308

Refresh WordPress Nightly

Refresh WordPress Nightly #308

name: 'Refresh WordPress Nightly'
on:
workflow_dispatch:
# Deploy the nightly version of WordPress 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 a Playground maintainer
if: >
github.ref == 'refs/heads/trunk' && (
github.actor == 'adamziel' ||
github.actor == 'dmsnell' ||
github.actor == 'bgrgicak' ||
github.actor == 'brandonpayton' ||
github.actor == 'zaerl'
)
runs-on: ubuntu-latest
environment:
name: wordpress-assets
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: 'Install bun'
run: |
curl -fsSL https://bun.sh/install | bash
- name: 'Recompile WordPress'
shell: bash
run: PATH="${PATH}:${HOME}/.bun/bin" npx nx bundle-wordpress:nightly playground-wordpress-builds
- name: Config git user
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 WordPress Nightly"
git pull --rebase
# Push if the pull did not result in a conflict
if [ $? -eq 0 ]; then
git push origin HEAD:trunk
fi;