ci: Add cloudrun build (#1097)

* add cloudrun image build
This commit is contained in:
Travis Groth 2020-07-17 12:01:30 -04:00 committed by GitHub
parent 408f201d16
commit 25867501d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 45 additions and 0 deletions

18
.github/Dockerfile-cloudrun vendored Normal file
View file

@ -0,0 +1,18 @@
FROM pomerium/vals-entrypoint as entrypoint
FROM busybox:latest as build
RUN touch /config.yaml
FROM gcr.io/distroless/base
ENV AUTOCERT_DIR /data/autocert
WORKDIR /pomerium
COPY pomerium* /bin/
COPY --from=build /config.yaml /pomerium/config.yaml
COPY --from=entrypoint /bin/vals-entrypoint /bin/vals-entrypoint
ENV ADDRESS ":8080"
ENV GRPC_INSECURE true
ENV INSECURE_SERVER true
ENTRYPOINT ["/bin/vals-entrypoint"]
CMD ["exec","--","/bin/pomerium","-config","/pomerium/config.yaml"]

View file

@ -105,3 +105,18 @@ dockers:
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--label=repository=http://github.com/pomerium/pomerium"
- "--label=homepage=http://www.pomerium.io"
- image_templates:
- "gcr.io/pomerium-io/pomerium:{{ .Tag }}-cloudrun"
dockerfile: .github/Dockerfile-cloudrun
binaries:
- pomerium
build_flag_templates:
- "--pull"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- "--label=repository=http://github.com/pomerium/pomerium"
- "--label=homepage=http://www.pomerium.io"

View file

@ -17,12 +17,24 @@ jobs:
uses: actions/setup-go@v1
with:
go-version: 1.14.x
- name: Set up Docker
run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
- uses: azure/docker-login@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
with:
project_id: pomerium-io
service_account_key: ${{ secrets.GCP_SERVICE_ACCOUNT }}
export_default_credentials: true
- name: Gcloud login
run: gcloud auth configure-docker
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with: