Skip to content

refactor: separate response logger #50

refactor: separate response logger

refactor: separate response logger #50

Workflow file for this run

# _
# _
# _ __ ___ ___ __ _| |_ ___
# | '__/ _ \ / __/ _` | __/ __|
# | | | (_) | (_| (_| | |_\__ \
# |_| \___/ \___\__,_|\__|___/
#
# https://github.com/rocats/apigateway-interceptor
#
# Copyright (C) 2023 @rocats
#
# This is a self-hosted software, liscensed under the Apache License.
# See /License for more information.
name: Build OCI Container (Prod)
on:
workflow_dispatch:
push:
branches:
- 'main'
env:
REGISTRY: quay.io
QUAY_USER: rocats
IMAGE_NAME: ${{ github.repository }}
DOCKERFILE: Dockerfile
DEPLOY_ENV: prod
jobs:
build:
strategy:
matrix:
include:
- os: linux
arch: amd64
platform: linux/amd64
- os: linux
arch: arm64
platform: linux/arm64
fail-fast: false
runs-on: ubuntu-latest
env:
CGO_ENABLED: 0
PYTHON_VERSION: 3.12
outputs:
IMAGE_URI: ${{ steps.metadata.outputs.tags }}
steps:
- uses: actions/checkout@master
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- uses: docker/metadata-action@v5
id: metadata
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,enable=true,format=short,prefix=${{ env.DEPLOY_ENV }}-,suffix=-${{ matrix.os }}-${{ matrix.arch }}
- name: Kaniko build - ${{ env.REGISTRY }}
id: quay_build
uses: aevea/action-kaniko@master
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.QUAY_USER }}
password: ${{ secrets.QUAY_PASS }}
image: ${{ env.IMAGE_NAME }}
build_file: ${{ env.DOCKERFILE }}
tag: ${{ fromJSON(steps.metadata.outputs.json).labels['org.opencontainers.image.version'] }}
tag_with_latest: false
cache: true
cache_registry: ${{ env.REGISTRY }}/${{ env.QUAY_USER }}/cache
extra_args: --build-arg PYTHON_VERSION=${{ env.PYTHON_VERSION }} --build-arg opts="GOARCH=${{ matrix.arch }}" --custom-platform ${{ matrix.platform }}
- name: Echo image uri
run: |
echo "ImageURI ${{ steps.metadata.outputs.tags }}"
push-multiarch-images:
needs: [build]
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
env:
QUAY_USER: rocats
steps:
- name: Login to ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.QUAY_USER }}
password: ${{ secrets.QUAY_PASS }}
- uses: docker/metadata-action@v5
id: metadata
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,enable=true,value={{sha}},prefix=${{ env.DEPLOY_ENV }}-
type=raw,value=latest
- name: Push multi-arch images
uses: int128/docker-manifest-create-action@v1
with:
tags: ${{ steps.metadata.outputs.tags }}
suffixes: |
-linux-amd64
-linux-arm64