Skip to content

Workflow file for this run

# Based on: https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages
# This action requires organization-level write permissions for the packages.
# See: https://stackoverflow.com/a/72585915/1796523
name: Create and publish the Docker images
on:
release:
types: ['released']
env:
REGISTRY: ghcr.io
jobs:
build-and-push-app:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: ${{ env.REGISTRY }}/biigle/app
- name: Build and push Docker image
uses: docker/build-push-action@v4.0.0
with:
context: .
file: .docker/app.dockerfile
build-args: BIIGLE_VERSION=${{ github.event.release.tag_name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-and-push-worker:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: ${{ env.REGISTRY }}/biigle/worker
- name: Build and push Docker image
uses: docker/build-push-action@v4.0.0
with:
context: .
file: .docker/worker.dockerfile
build-args: BIIGLE_VERSION=${{ github.event.release.tag_name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-and-push-web:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Log in to the Container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: ${{ env.REGISTRY }}/biigle/web
- name: Build and push Docker image
uses: docker/build-push-action@v4.0.0
with:
context: .
file: .docker/web.dockerfile
build-args: BIIGLE_VERSION=${{ github.event.release.tag_name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max