Skip to content

Conversation

@jorgeatorres
Copy link
Member

@jorgeatorres jorgeatorres commented Jul 1, 2025

This PR:

  • Updates the cache and checkout action versions used in this workflow, with v2 no longer being supported.
  • Updates the PHP version in use for the Composer step, with 7.4 no longer being supported by the required packages.
  • Makes the version input optional, defaulting to building the docs for the latest WC version from the woocommerce repository.
  • Adds some logic to prevent re-building the code reference for a version that was already built.
  • Turns the workflow into a cron job that runs at 23:00 UTC every day.

Closes woocommerce/woocommerce#57960.

Testing instructions

  1. Fork the woocommerce/woocommerce repository.
  2. In this fork, create two draft releases:
    1. One with tag name 9.9.4, marked as the latest and attaching the ZIP from WordPress.org as woocommerce.zip.
    2. One with tag name 9.9.5, marked as the latest and attaching the ZIP from WordPress.org as woocommerce.zip.
  3. Fork this repository as well (woocommerce/code-reference). Make sure that your fork has all branches (not just trunk) and that this branch (deploy-job-fixes) is merged into trunk.
  4. In your fork of code-reference:
    1. Ensure that actions are enabled in the Actions tab.

    2. In Settings > Pages, set Source to deploy from the gh-pages branch.

    3. Go to https://<your username>.github.io/code-reference/classes/WooCommerce.html#property_version and confirm that you see that $version is said to be set to 9.8.5.

      Note: You might need to wait a few mins for GH pages to be deployed.

  5. Publish the 9.9.4 release in your fork of the core repo.
  6. Run workflow GitHub Pages deploy in your fork of the code-reference repo and wait until it completes.
  7. After a few minutes you should be able to refresh https://<your username>.github.io/code-reference/classes/WooCommerce.html#property_version and see that 9.9.4 is now the number associated to $version, meaning the docs were re-generated from the new version.
  8. Run workflow GitHub Pages deploy again and confirm that the second job (Build and deploy) is now skipped. This is because the docs for the latest version were already built.
  9. Publish the 9.9.5 release in your fork of the core repo.
  10. Run workflow GitHub Pages deploy in your fork of the code-reference repo and wait until it completes.
  11. After a few minutes you should be able to refresh https://<your username>.github.io/code-reference/classes/WooCommerce.html#property_version and confirm that the docs now correspond to version 9.9.5.
@jorgeatorres jorgeatorres changed the title Deploy job fixes Various deploy job fixes Jul 1, 2025
@jorgeatorres jorgeatorres marked this pull request as ready for review July 1, 2025 17:44
@jorgeatorres jorgeatorres requested review from a team, joshuatf and prettyboymp and removed request for a team and prettyboymp July 2, 2025 10:40
Copy link

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @jorgeatorres, still testing this, but got stuck on the GitHub Pages Deploy workflow. Manually running the workflow from trunk does not seem to start the job. Did I miss a step?

Screenshot 2025-07-08 at 8 12 28 PM
Copy link

@joshuatf joshuatf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For some reason I cannot trigger my workflow, but pre-approving as the code looks good to me and this is relatively low risk. I can see things working on your branch.

Left one comment on updating a deprecated function. If you feel more comfortable bringing in another reviewer to check the workflow, we can also do that.

@jorgeatorres jorgeatorres merged commit ad2a1db into trunk Jul 9, 2025
@jorgeatorres jorgeatorres deleted the deploy-job-fixes branch July 9, 2025 20:38
@jorgeatorres
Copy link
Member Author

jorgeatorres commented Jul 10, 2025

Just adding that after the merge the job did indeed run as scheduled yesterday and updated the docs (which were at 9.8.5) to the 9.9.5 version: https://woocommerce.github.io/code-reference/classes/WooCommerce.html#property_version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants