Skip to content

Container Images

Container Images #2

name: Container Images
on:
workflow_dispatch:
push:
branches:
- main
create:
tags:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Docker image
run: |
tag="${GITHUB_REF##*/}"
if [ "$tag" = 'main' ]; then tag='latest'; fi
image_name="ghcr.io/docspell/joex:${tag}"
docker build --cache-from type=gha --cache-to type=gha,mode=max -t "$image_name" .
docker push "$image_name"