Skip to content

fix tlru race condition #130

fix tlru race condition

fix tlru race condition #130

Workflow file for this run

name: Docker build
on:
workflow_dispatch:
pull_request:
push:
branches:
- trunk
jobs:
build-images:
name: Build Docker Images
strategy:
matrix:
arch: [amd64, armv8]
features: [metrics, ""]
runs-on: ${{ matrix.arch == 'armv8' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }}
env:
TAG: ${{ matrix.features && format('metrics-{0}', matrix.arch) || matrix.arch }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Login to ghcr
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | podman login -u ${{ github.repository_owner }} --password-stdin ghcr.io
- name: Convert GITHUB_REPOSITORY into lowercase
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Build
run: |
podman build \
--format docker \
--build-arg FEATURES=${{ matrix.features }} \
-t http-proxy:${TAG} \
.
- name: Push image
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
run: |
podman tag http-proxy:${TAG} ghcr.io/${REPO}:${TAG}
podman push ghcr.io/${REPO}:${TAG}
create-manifest:
name: Create Docker manifests
runs-on: ubuntu-latest
needs: build-images
if: github.ref == 'refs/heads/trunk' && github.event_name != 'pull_request'
steps:
- name: Login to ghcr
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | podman login -u ${{ github.repository_owner }} --password-stdin ghcr.io
- name: Convert GITHUB_REPOSITORY into lowercase
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV}
- name: Create manifest and push it
run: |
podman manifest create http-proxy-latest docker://ghcr.io/${REPO}:amd64 docker://ghcr.io/${REPO}:armv8
podman manifest create http-proxy-metrics docker://ghcr.io/${REPO}:metrics-amd64 docker://ghcr.io/${REPO}:metrics-armv8
podman manifest push --format v2s2 http-proxy-latest docker://ghcr.io/${REPO}:latest
podman manifest push --format v2s2 http-proxy-metrics docker://ghcr.io/${REPO}:metrics