chore(deps): update axum-valid requirement from 0.22.0 to 0.23.0 (#496) #308
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Build | |
on: | |
release: | |
types: | |
- published | |
push: | |
branches: | |
- main | |
- '*docker*' | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.ref }}" | |
cancel-in-progress: true | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
max-parallel: 8 | |
matrix: | |
platform: | |
- linux/amd64 | |
- linux/arm64 | |
image_type: | |
- name: meteroid-api | |
dockerfile: modules/meteroid/api.Dockerfile | |
- name: meteroid-scheduler | |
dockerfile: modules/meteroid/scheduler.Dockerfile | |
- name: metering-api | |
dockerfile: modules/metering/Dockerfile | |
- name: meteroid-web | |
dockerfile: modules/web/web-app/Dockerfile | |
include: | |
- platform: linux/amd64 | |
mold_arch: x86_64 | |
proto_arch: x86_64 | |
grpc_health_probe_arch: amd64 | |
prefix: amd64 | |
runs_on: ubuntu-latest | |
- platform: linux/arm64 | |
mold_arch: aarch64 | |
proto_arch: aarch_64 | |
grpc_health_probe_arch: arm64 | |
prefix: arm64 | |
runs_on: ubuntu-24.04-arm | |
runs-on: ${{ matrix.runs_on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Cargo CI config | |
run: | | |
mkdir -p .cargo && ln -s ../.cargo-templates/ci.toml $_/config.toml | |
- name: Prepare env | |
run: | | |
platform=${{ matrix.platform }} | |
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push | |
uses: docker/build-push-action@v6 | |
id: build | |
with: | |
context: . | |
file: ${{ matrix.image_type.dockerfile }} | |
platforms: ${{ matrix.platform }} | |
build-args: | | |
MOLD_ARCH=${{ matrix.mold_arch }} | |
PROTO_ARCH=${{ matrix.proto_arch }} | |
GRPC_HEALTH_PROBE_ARCH=${{ matrix.grpc_health_probe_arch }} | |
PROFILE=release | |
CI=${{ env.CI }} | |
push: true | |
# layer caching | |
cache-from: type=gha | |
cache-to: type=gha,mode=max,ignore-error=true | |
# https://github.com/docker/build-push-action/issues/900 | |
provenance: false | |
outputs: type=image,name=ghcr.io/meteroid-oss/${{ matrix.image_type.name }},push-by-digest=true,name-canonical=true,push=true,store=true | |
- name: Export digest | |
run: | | |
mkdir -p /tmp/digests/${{ matrix.image_type.name }} | |
digest="${{ steps.build.outputs.digest }}" | |
touch "/tmp/digests/${{ matrix.image_type.name }}/${digest#sha256:}" | |
- name: Upload digest | |
uses: actions/upload-artifact@v4 | |
with: | |
name: digests-${{ matrix.image_type.name }}-${{ env.PLATFORM_PAIR }} | |
path: /tmp/digests/${{ matrix.image_type.name }}/* | |
retention-days: 1 | |
manifest: | |
needs: build | |
strategy: | |
matrix: | |
image_type: | |
- meteroid-api | |
- meteroid-scheduler | |
- metering-api | |
- meteroid-web | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download digests | |
uses: actions/download-artifact@v4 | |
with: | |
path: /tmp/digests | |
pattern: digests-${{ matrix.image_type }}-* | |
merge-multiple: true | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Docker meta | |
id: meteroid-docker # you'll use this in the next step | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/meteroid-oss/${{ matrix.image_type }} | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
type=sha | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create and push manifest list | |
working-directory: /tmp/digests | |
run: | | |
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | |
$(printf 'ghcr.io/meteroid-oss/${{ matrix.image_type }}@sha256:%s ' *) | |
- name: Push tip tag | |
if: github.ref == 'refs/heads/main' | |
working-directory: /tmp/digests | |
run: | | |
docker buildx imagetools create \ | |
--tag ghcr.io/meteroid-oss/${{ matrix.image_type }}:tip \ | |
$(printf 'ghcr.io/meteroid-oss/${{ matrix.image_type }}@sha256:%s ' *) |