Skip to content

feat: add TLS support #54

feat: add TLS support

feat: add TLS support #54

Workflow file for this run

name: Build OCI Image
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: none
jobs:
build:
name: Build ${{ matrix.variant.name }} image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
variant:
- name: Alpine
tag: alpine
dockerfile: Dockerfile.alpine
- name: Ubuntu
tag: ubuntu
dockerfile: Dockerfile
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Login to GHCR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
if: ${{ github.event_name != 'pull_request' }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Set up Docker Metadata
id: meta
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c # v5.5.0
with:
images: ghcr.io/${{ github.repository }}
flavor: |
latest=auto
prefix=${{ matrix.variant.tag }}-,onlatest=true
tags: |
type=edge
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
push: ${{ github.event_name != 'pull_request' }}
cache-from: type=gha,scope=${{ matrix.variant.tag }}
cache-to: type=gha,mode=max,scope=${{ matrix.variant.tag }}
context: .
file: ${{ matrix.variant.dockerfile }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
devcontainer:
name: Build devcontainer image
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Install @devcontainers/cli
run: npm install -g @devcontainers/cli
- name: Build image
run: devcontainer build --workspace-folder .
- name: Start image
run: devcontainer up --workspace-folder . --id-label codespace=tfhttp
- name: Build
run: |
devcontainer exec --workspace-folder . --id-label codespace=tfhttp -- sh -c '
cd /workspaces/tfhttp && \
cmake -B /tmp/build -DCMAKE_BUILD_TYPE=Release -DBUILD_STATIC_BINARY=off -DBUILD_MOSTLY_STATIC_BINARY=on && \
cmake --build /tmp/build'
- name: Clean up
if: always()
run: |
ID=$(docker ps -q --filter label=codespace=tfhttp)
if [ -n "${ID}" ]; then
docker container stop "${ID}"
docker container rm "${ID}"
fi