planetscale / ghcommit-action

GitHub Action to commit files to a git branch using the ghcommit utility
Apache License 2.0
30 stars 4 forks source link

[minor] optimize docker pulls when action is executed #74

Closed joemiller closed 1 week ago

joemiller commented 1 week ago

When a docker-based github-action is run in a workflow, github pulls the repo and then builds an image from the Dockerfile every time. In our case this involves downloading and installing some apk packages. We can pre-bake this image and save some bandwidth and time.

  1. Moved the release job out of the ci.yaml workflow and into a new release.yaml GHA workflow. Release runs only on main merges.
  2. New Dockerfile.base contains all of the apk dependencies. It creates the runtime image
  3. Release workflow builds Dockerfile.base and pushes to ghcr.io/planetscale/ghcommit-action:v${new_version}. autotag is still used to calculate the $new_version.
  4. Release workflow updates the version in Dockerfile and commits back to the main branch.

The runtime Dockerfile is now a 1-liner referencing ghcr.io/planetscale/ghcommit-action:v${new_version}'

This commit contains [minor] in the commit message which will trigger autotag to increment the minor version. This will be the start of v0.2.0.