mirror of
https://github.com/Arcadia-Solutions/arcadia.git
synced 2025-12-16 23:14:15 -06:00
62 lines
1.5 KiB
YAML
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
|
|
|