Skip to content

Feat/docs

Feat/docs #24

Workflow file for this run

name: Docker publish
on:
workflow_call:
pull_request:
jobs:
docker-publish:
name: Publish docker
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 🐳 Prepare Docker
id: prep
uses: ./.github/actions/prep
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 🐳 Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: 🐳 Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.ref }}
restore-keys: |
${{ runner.os }}-buildx-refs/develop
${{ runner.os }}-buildx-
- name: 🐳 Build image
uses: docker/build-push-action@v6
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: Dockerfile
target: web-app-serve
push: false
load: true
provenance: false # XXX: Without this we have untagged images in ghcr.io
tags: ${{ steps.prep.outputs.docker_image }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: 🐳 Docker push
if: github.event_name != 'pull_request'
env:
DOCKER_IMAGE: ${{ steps.prep.outputs.docker_image }}
run: docker push $DOCKER_IMAGE