release: 2.4.0 #52
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: 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: | |
images: ghcr.io/beyondessential/tamanu-meta | |
tags: | | |
type=semver,value=v${{ steps.version.outputs.version }},pattern={{version}} | |
type=semver,value=v${{ steps.version.outputs.version }},pattern={{major}}.{{minor}} | |
type=semver,value=v${{ steps.version.outputs.version }},pattern={{major}} | |
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 | |
cache-to: type=gha,mode=max | |
push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }} | |
labels: ${{ steps.meta.outputs.labels }} | |
tags: ${{ steps.meta.outputs.tags }} |