Skip to content

Release

Release #15

Workflow file for this run

name: Release
on:
workflow_dispatch:
schedule:
- cron: "0 20 * * 1" # Build every Monday 8PM UTC - Tuesday 8AM NZST
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
AWS_REPO_NAME: kademi-less
PLATFORMS: linux/amd64,linux/arm64
jobs:
build-push-image:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::826388764847:role/GithubOIDC-Kademi-Less
aws-region: us-east-1
- name: Login to Amazon ECR Private
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
${{ steps.login-ecr.outputs.registry }}/${{ env.AWS_REPO_NAME }}
flavor: |
latest=true
tags: |
{{date 'YYYYMMDDHHmm'}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker-container
driver-opts: image=moby/buildkit:master
use: true
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: ${{ env.PLATFORMS }}