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 changeset
to create a changeset describing the change to users. - Commit your changes.
- Open a pull request to the
main
branch. - Once all checks are passing and the PR is approved, Squash and Merge into the
main
branch.
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 "Version Action" PR.
- Review the PR:
- Changelog entries were created.
- Version number in package.json was bumped.
- All
.changeset/*.md
files 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 base of the Dockerfile
is hosted as a Docker image on DockerHub. The image is originally built locally from Dockerfiles/Dockerfile
and pushed up to DockerHub.
The main Dockerfile
at the project root imports the wpengine/gha:base-stable
hosted image from DockerHub. Customizations to the image should be added below the base image for code that is updated more frequently, such as:
- entrypoint.sh
- exclude.txt
All other customizations that are updated less frequently, or managed by 3rd parties, should be added to the base-stable
image. Rebuild and push the image to DockerHub to update the image.
The base-stable
Docker Image will rarely need to be updated, however it may be necessary to update it manually* from time to time.
-
Build the docker image locally:
docker build --no-cache -t wpengine/gha:base-stable Dockerfiles
-
Push the image to DockerHub:
docker push wpengine/gha:base-stable
Once the hosted Docker image is updated, it will need to be imported (or updated) on the main project Dockerfile
. If the Dockerhub tag name (image version) has changed, update the existing line in the project root Dockerfile
to match the new tag name.
- Update the root Docker file for the project with the latest version of the Docker Image:tagname. i.e.:
FROM wpengine/gha:base-stable
*TO DO: Process will be automated in the future.