Files
arcadia/.github/workflows/publish_images.yaml
Shehab Ali Tweel 38a483f165 cache EVERYTHING
2025-04-27 22:12:01 +02:00

62 lines
1.5 KiB
YAML

name: Publish container image
on:
release:
types: [ published ]
workflow_dispatch:
inputs:
always_push:
description: Push the resulting image? (Overrides anything!)
default: false
type: boolean
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Set up Docker
uses: docker/setup-docker-action@v4
with:
daemon-config: |
{
"debug": true,
"features": {
"containerd-snapshotter": true
}
}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Log in to the Container Registry
uses: docker/login-action@v3.4.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: ./backend
push: ${{ inputs.always_push || github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-to: type=gha
cache-from: type=gha,mode=max