Before you get started, we recommend installing Node Version Manager to help manage node and npm versions. Next, from your local copy of the action run nvm use and npm install. You're ready to start coding!
We use the feature branch workflow. The workflow for a typical code change looks like this:
- Create a new branch for the feature.
- Make changes to the code.
- Use
npx changesetto create a changeset describing the change to users. - Commit your changes.
- Open a pull request to the
mainbranch. - Once all checks are passing and the PR is approved, Squash and Merge into the
mainbranch.
We use Changesets to automate versioning and releasing. When you are ready to release, the first step is to create the new version.
- Go to pull requests and view the automated "Version Image" PR.
- Review the PR:
- Changelog entries were created.
- Version number in package.json was bumped.
- All
.changeset/*.mdfiles were removed.
- Approve, then "Squash and merge" the PR into
main.
Merging the versioning PR will run a workflow that creates or updates all necessary tags. It will also create a new release in GitHub.
The Dockerfile is hosted as a Docker image on DockerHub: wpengine/sitedeploy.
The Docker image is used in both wpengine/github-action-wpe-site-deploy GitHub Action and the wpengine/wpe-site-deploy Bitbucket Pipe. Any customizations to the image should consider the effect on both services.
Docker images are built and pushed automatically:
| Trigger | Tags Updated | Source |
|---|---|---|
Push to main |
latest |
Docker Hub Autobuild |
| New version release | latest, vX, vX.Y, vX.Y.Z |
Docker Hub Autobuild |
| Monthly schedule (1st of month) | latest, vX, vX.Y, vX.Y.Z |
GitHub Actions |
| Manual trigger | latest, vX, vX.Y, vX.Y.Z |
GitHub Actions |
The scheduled monthly rebuild ensures security patches are applied even when there are no new releases. Both the scheduled and manually triggered workflows use no-cache to pull fresh base image layers.
The Dockerfile uses Alpine Linux as its base image. The base image follows this update pattern:
- Dependabot monitors for new Alpine versions and creates PRs automatically
- Alpine releases new versions every 6 months (roughly June and December)
- Scheduled rebuilds pick up security patches from
apk upgrademonthly
When Dependabot opens a PR for a new Alpine version:
- Review the Alpine release notes for breaking changes and ensure tests are passing.
- Add a changeset to the PR (
npx changeset) so a proper release is created when merged - Merge the PR to trigger a new versioned release
You can also build and version this image using make targets when necessary.
make build # Builds the image locally
make version # Builds the image and creates version tags
make list-images # Shows all tagged versions of the image
make clean # Deletes all tagged versions of the image