-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rebuild WordPress every 20 minutes, short-circuit if no new version i…
…s found (#1061) Splits the WordPress building flow into: * Nightly version – rebuilt every 24 hours * Major releases and betas – rebuilt every 20 minutes provided a new major version is available This should ensure that new WordPress beta versions are deployed shortly after the release parties. ## Testing instructions There isn't a good way of testing CI actions :( Eyeball the code, run `nx bundle-wordpress:major-and-beta playground-wordpress`, and hope for the best. I'll be monitoring GitHub actions after merging this PR.
- Loading branch information
Showing
4 changed files
with
126 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: 'Refresh WordPress Major&Beta' | ||
|
||
on: | ||
workflow_dispatch: | ||
# Every 20 minutes | ||
schedule: | ||
- cron: '*/20 * * * *' | ||
|
||
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' | ||
) | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: wordpress-assets | ||
concurrency: | ||
group: check-version-and-run-build | ||
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 bundle-wordpress:major-and-beta playground-wordpress | ||
- 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 major and beta versions" | ||
git pull --rebase | ||
# Push if the pull did not result in a conflict | ||
if [ $? -eq 0 ]; then | ||
git push origin HEAD:trunk | ||
fi; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters