forked from cloudflare/privacy-gateway-server-go
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a workflow to build the included Dockerfile on PRs and merges to `main`. Additionally, adds a `-version` flag to the binary, which makes it print out `argv[0]` and the `debug.BuildInfo` ([1]) embedded in the binary. This is just so that there's some way to run the binary such that it will exit with status 0 immediately, which lets us verify in CI that the container was built properly. We also embed the git SHA into a label on the container image. [1]: https://pkg.go.dev/runtime/debug#BuildInfo
- Loading branch information
1 parent
17d3a61
commit c98c15e
Showing
3 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: docker | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
DOCKER_BUILDKIT: 1 | ||
|
||
jobs: | ||
ohttp-gateway: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: echo "GIT_REVISION=$(git describe --always --dirty=-modified)" >> $GITHUB_ENV | ||
- run: docker build \ | ||
--tag "privacy-gateway-server-go" \ | ||
--build-arg GIT_REVISION=${GIT_REVISION} \ | ||
-f Dockerfile \ | ||
. | ||
- run: docker run --rm --tag "privacy-gateway-server-go" -version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters