Skip to content

Commit

Permalink
Merge pull request #2 from mcpherrinm/mattm-ct-test-srv-container
Browse files Browse the repository at this point in the history
Add dockerfile and GHA to build and publish ct-test-srv container
  • Loading branch information
mcpherrinm authored Dec 15, 2024
2 parents 2678e68 + dc8bfd4 commit 77bab30
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/container-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Build containers on every PR
# See also container-release.yml

name: Container Build

on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build-container:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- dockerfile: test/ct-test-srv/Dockerfile
image: ghcr.io/mcpherrinm/ct-test-srv
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Build
run: docker buildx . -f "${{ matrix.image }}" -t "${{ image }}"
37 changes: 37 additions & 0 deletions .github/workflows/container-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Build and publish containers for this release
# see also container-build.yml

name: Container Release

on:
push:
tags:
- release-*

jobs:
push-container:
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- dockerfile: TBD
image: ghcr.io/mcpherrinm/boulder
- dockerfile: test/ct-test-srv/Dockerfile
image: ghcr.io/mcpherrinm/ct-test-srv
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Build
run: docker buildx . -f "${{ matrix.image }}" -t "${{ image }}"

- name: login
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin

- name: Push
run: docker push "${{ image }}:${{ github.ref_name }}"
19 changes: 19 additions & 0 deletions test/ct-test-srv/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM golang:1.23.4 AS build

WORKDIR /app

COPY go.mod go.sum vendor ./

COPY . .

RUN go build -o /bin/ct-test-srv ./test/ct-test-srv/main.go

FROM ubuntu:24.04

COPY --from=build /bin/ct-test-srv /bin/ct-test-srv

COPY test/ct-test-srv/ct-test-srv.json /etc/ct-test-srv.json

ENTRYPOINT ["/bin/ct-test-srv"]

CMD ["-config", "/etc/ct-test-srv.json"]

0 comments on commit 77bab30

Please sign in to comment.