-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically Run Tests on PR and Push Docker Image #38
Conversation
481f4bd
to
de1e183
Compare
This looks great. Should I do something else than setting the tokens? |
Yep @dunglas, you should just need to set the secrets. IIRC, there might be a button right around the merge button that allows this PR to build in GitHub actions. It also might be buried in a setting somewhere. Otherwise, you'll have to merge it to see if it works. |
I think everything is working well and this is ready for review. There are some test images built on my Docker Hub using these changes. I have some ideas to greatly decrease the build time, but it'll be a while before I have the time to get to it (essentially create the base image in your fork of I've also basically made up some release documentation, but we can delete it, change it, or do whatever you feel is appropriate. I mostly put it there to document how to use these changes. |
|
||
COPY . . | ||
COPY *.* . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to *.*
because my editor likes to put things in a dotfile, which caused the cache to always blow up.
labels: ${{ steps.meta.outputs.labels }} | ||
builder: ${{ steps.buildx.outputs.name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a new line here.
labels: ${{ steps.meta.outputs.labels }} | ||
builder: ${{ steps.buildx.outputs.name }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a new line here.
Don't bother with that, I think that I'll manage to make FrankenPHP compatible with upstream 8.2 soon. |
Thank you! |
This uses GitHub Actions to automatically run the tests in Docker via
go test
and publish successful builds to a Docker registry::pr-#
, e.g.,frankenphp:pr-38
(subject to actions approval by maintainer)main
branch is pushed to:main
tags
are pushed tolatest
and if using semver, corresponding tags, e.g., tagv1.2.3
is tagged:1.2
,:1.2.3
, andlatest
See the Docker metadata action for more information.
Requires several repo secrets:
REGISTRY_LOGIN_SERVER
: The URL to push the docker image to.REGISTRY_USERNAME
: The username/org to login as.REGISTRY_PASSWORD
: The password to login with.REGISTRY_REPO
: The repository to push the docker image to.What is built
Note that this builds
amd64
andarm64
images and the first time this is built per branch takes ~2.5 hours.Documentation
I've added some documentation about how this works, but I kinda just made it up. So we can change it here, you can change it after we merge it, or we can delete it in this PR to be added later.