Skip to content

Merge pull request #62 from NillionNetwork/release/1.0.0 #52

Merge pull request #62 from NillionNetwork/release/1.0.0

Merge pull request #62 from NillionNetwork/release/1.0.0 #52

Workflow file for this run

name: Publish nilauth to ECR
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
id-token: write # Required for OIDC
contents: read
jobs:
build-and-push-arch:
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
platform: linux/amd64
runner: ubuntu-latest
- arch: arm64
platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "arn:aws:iam::054037142884:role/nilauth-github"
aws-region: "us-east-1"
- name: Log in to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Extract metadata for version
id: meta_tag
uses: docker/metadata-action@v5
with:
images: public.ecr.aws/k5d9x2g2/nilauth
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,prefix=
flavor: |
latest=false
- name: Build and push arch-specific image
uses: docker/build-push-action@v6
with:
context: .
platforms: ${{ matrix.platform }}
push: true
tags: public.ecr.aws/k5d9x2g2/nilauth:${{ github.sha }}-${{ matrix.arch }}
build-args: |
VERSION=${{ steps.meta_tag.outputs.version }}
cache-from: type=gha
cache-to: type=gha,mode=max
provenance: false
create-and-push-manifest:
runs-on: ubuntu-latest
needs: build-and-push-arch
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: "arn:aws:iam::054037142884:role/nilauth-github"
aws-region: "us-east-1"
- name: Log in to Amazon ECR
uses: aws-actions/amazon-ecr-login@v2
with:
registry-type: public
- name: Extract final tags
id: meta
uses: docker/metadata-action@v5
with:
images: public.ecr.aws/k5d9x2g2/nilauth
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,prefix=
flavor: |
latest=false
- name: Create and push multi-arch manifest
run: |
echo "${{ steps.meta.outputs.tags }}" > tags.txt
while IFS= read -r tag; do
if [ -n "$tag" ]; then
echo "Creating and pushing manifest for tag: $tag"
docker manifest create "$tag" \
public.ecr.aws/k5d9x2g2/nilauth:${{ github.sha }}-amd64 \
public.ecr.aws/k5d9x2g2/nilauth:${{ github.sha }}-arm64
docker manifest push "$tag"
fi
done < tags.txt