Skip to content

ci: add release engineering #13

ci: add release engineering

ci: add release engineering #13

Workflow file for this run

name: CD
on:
push:
branches: [main]
tags: ['v*.*.*']
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write # to update the release
packages: write # to pull and push images
jobs:
images:
name: Build container images
runs-on: ubuntu-latest
steps:
- name: Login to ghcr.io
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- uses: actions/checkout@v4
- name: Extract version
id: version
run: echo "version=$(cargo pkgid | cut -d@ -f2)" >> "$GITHUB_OUTPUT"
- name: Setup buildkit
uses: docker/setup-buildx-action@v3
- uses: docker/metadata-action@v5
id: meta
with:
labels: |
org.opencontainers.image.vendor=BES
org.opencontainers.image.title=Tamanu Meta Server
org.opencontainers.image.url=https://www.bes.au/products/tamanu/
org.opencontainers.image.source=https://github.com/beyondessential/tamanu-meta-server/
org.opencontainers.image.version=${{ steps.version.outputs.version }}
org.opencontainers.image.licenses=GPL-3.0-or-later
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
cache-from: type=gha,scope=container-${{ github.ref_name }}
cache-to: type=gha,mode=max,scope=container-${{ github.ref_name }}
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
labels: ${{ steps.meta.outputs.labels }}
tags: |
ghcr.io/beyondessential/tamanu-meta:v${{ steps.version.outputs.version }}
ghcr.io/beyondessential/tamanu-meta:latest