mirror of
https://github.com/immich-app/base-images.git
synced 2025-09-10 07:24:16 +02:00
67 lines
1.9 KiB
YAML
67 lines
1.9 KiB
YAML
name: Build and Push Server Base Images
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
packages: write
|
|
|
|
jobs:
|
|
pre-job:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
outputs:
|
|
should_run: ${{ steps.found_paths.outputs.server == 'true' || steps.should_force.outputs.should_force == 'true' }}
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
persist-credentials: false
|
|
- id: found_paths
|
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
|
with:
|
|
filters: |
|
|
server:
|
|
- 'server/**'
|
|
workflow:
|
|
- '.github/workflows/build-server-base.yml'
|
|
- name: Check if we should force jobs to run
|
|
id: should_force
|
|
run: echo "should_force=${{ steps.found_paths.outputs.workflow == 'true' || startsWith(github.ref, 'refs/tags') || github.ref_name == 'main' }}" >> "$GITHUB_OUTPUT"
|
|
|
|
build_and_push:
|
|
needs: pre-job
|
|
uses: immich-app/devtools/.github/workflows/multi-runner-build.yml@129aeda75a450666ce96e8bc8126652e717917a7 # multi-runner-build-workflow-0.1.1
|
|
if: ${{ needs.pre-job.outputs.should_run == 'true' }}
|
|
strategy:
|
|
fail-fast: true
|
|
matrix:
|
|
target: ["dev", "prod"]
|
|
permissions:
|
|
contents: read
|
|
actions: read
|
|
packages: write
|
|
with:
|
|
image: base-server-${{ matrix.target }}
|
|
context: server
|
|
dockerfile: server/Dockerfile
|
|
|
|
success-check:
|
|
needs: build_and_push
|
|
permissions: {}
|
|
runs-on: ubuntu-latest
|
|
if: always()
|
|
steps:
|
|
- uses: immich-app/devtools/actions/success-check@68f10eb389bb02a3cf9d1156111964c549eb421b # 0.0.4
|
|
with:
|
|
needs: ${{ toJSON(needs) }}
|