Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: martabal/docker-immich
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.106.4
Choose a base ref
...
head repository: martabal/docker-immich
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
18 changes: 0 additions & 18 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
# Auto detect text files and perform LF normalization
* text=auto

# Custom for Visual Studio
*.cs diff=csharp

# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

Dockerfile.j2 linguist-language=Dockerfile
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -4,6 +4,10 @@ updates:
directory: "/"
schedule:
interval: "daily"
groups:
ci-dependencies:
patterns:
- "*"
- package-ecosystem: "pip"
directory: "/"
schedule:
63 changes: 63 additions & 0 deletions .github/workflows/docker-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Docker Cleanup

on:
pull_request:
types:
- "closed"
push:
paths:
- ".github/workflows/docker-cleanup.yml"
workflow_dispatch:

concurrency:
group: registry-tags-cleanup
cancel-in-progress: false

jobs:
cleanup-images:
if: github.event_name != 'workflow_dispatch'
name: Cleanup Stale Images Tags for ${{ matrix.primary-name }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- primary-name: "immich"
env:
# Requires a personal access token with the OAuth scope delete:packages
TOKEN: ${{ secrets.PACKAGE_DELETE_TOKEN }}
steps:
- name: Clean temporary images
if: "${{ env.TOKEN != '' }}"
uses: stumpylog/image-cleaner-action/ephemeral@v0.10.0
with:
token: "${{ env.TOKEN }}"
owner: "${{ github.repository_owner }}"
do_delete: "true"
package_name: "${{ matrix.primary-name }}"
scheme: "pull_request"
repo_name: "${{ github.event.repository.name }}"
match_regex: '^pr-(\d+)$|^(\d+)$'

cleanup-untagged-images:
name: Cleanup Untagged Images Tags for ${{ matrix.primary-name }}
runs-on: ubuntu-24.04
needs:
- cleanup-images
strategy:
fail-fast: false
matrix:
include:
- primary-name: "immich"
env:
# Requires a personal access token with the OAuth scope delete:packages
TOKEN: ${{ secrets.PACKAGE_DELETE_TOKEN }}
steps:
- name: Clean untagged images
if: "${{ env.TOKEN != '' }}"
uses: stumpylog/image-cleaner-action/untagged@v0.10.0
with:
token: "${{ env.TOKEN }}"
owner: "${{ github.repository_owner }}"
do_delete: "true"
package_name: "${{ matrix.primary-name }}"
67 changes: 52 additions & 15 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -7,10 +7,22 @@ on:
description: "version"
required: false
type: string
base_image_tag:
description: "base image tag"
required: false
type: string
push:
branches: ["main"]
paths:
- "templates/**"
- "root/**"
- ".github/**"
pull_request:
branches: ["main"]
paths:
- "templates/**"
- "root/**"
- ".github/**"
schedule:
- cron: "0 12 * * 3"

@@ -83,32 +95,43 @@ jobs:
exit 1
fi
fi
if [ "${{ inputs.base_image_tag }}" != '' ]; then
base_image_tag="${{ inputs.base_image_tag }}"
else
mkdir /tmp/immich
curl -o \
/tmp/immich.tar.gz -L \
"https://github.com/immich-app/immich/archive/${immich_version}.tar.gz" && \
tar xf \
/tmp/immich.tar.gz -C \
/tmp/immich --strip-components=1 && \
dockerfile_content=$(cat /tmp/immich/server/Dockerfile)
date=$(echo "$dockerfile_content" | grep -oP 'base-server-prod:\K[^@]+(?=@)')
if [ -z "$date" ]; then
base_image_tag="latest";
else
base_image_tag="$date";
fi
fi
short_version="${immich_version#v}"
echo "immich_version=${immich_version}" >> $GITHUB_OUTPUT
echo "build_date=$(date +'%Y-%m-%dT%H:%M:%S%:z')" >> $GITHUB_OUTPUT
echo "short_date=$(date '+%Y%m%d')" >> $GITHUB_OUTPUT
echo "commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
echo "short_version=${short_version}" >> $GITHUB_OUTPUT
echo "base_image_tag=${base_image_tag}" >> $GITHUB_OUTPUT
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Setup poetry
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "poetry"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install python dependencies
run: poetry install --without dev,test
run: |
uv venv
uv pip install -r pyproject.toml
- name: Create Dockerfile from template
run: poetry run python3 render_templates/main.py --flavor ${{ matrix.image }} --print-dockerfile
run: uv run python3 -m render_templates.main --flavor ${{ matrix.image }} --print-dockerfile --enable-patches --immich-version ${{ steps.tags.outputs.immich_version }}

- name: Generate docker image tags
id: metadata
@@ -150,4 +173,18 @@ jobs:
tags: ${{ steps.metadata.outputs.tags }}
build-args: |
BUILD_VERSION=${{ steps.tags.outputs.build_date }}
BUILD_ID=${{ github.run_id }}
BUILD_IMAGE=${{ matrix.image == 'cpu' && 'latest' || matrix.image }}
BUILD_IMAGE_URL=https://github.com/${{ github.repository }}/pkgs/container/immich
BUILD_REPOSITORY=${{ github.repository }}
BUILD_REPOSITORY_URL=https://github.com/${{ github.repository }}
BUILD_SOURCE_COMMIT=${{ github.sha }}
BUILD_SOURCE_REF=${{ github.ref_name }}
BUILD_SOURCE_URL=https://github.com/${{ github.repository }}/commit/${{ github.sha }}
BUILD_URL=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
BASE_IMAGE_TAG=${{ steps.tags.outputs.base_image_tag }}
IMMICH_VERSION=${{ steps.tags.outputs.immich_version }}
THIRD_PARTY_BUG_FEATURE_URL=https://github.com/${{ github.repository }}/issues
THIRD_PARTY_DOCUMENTATION_URL=https://github.com/${{ github.repository }}/blob/main/README.md
THIRD_PARTY_SOURCE_URL=https://github.com/${{ github.repository }}
THIRD_PARTY_SUPPORT_URL=https://github.com/${{ github.repository }}/discussions
21 changes: 20 additions & 1 deletion .github/workflows/external-trigger.yml
Original file line number Diff line number Diff line change
@@ -68,8 +68,27 @@ jobs:
--generate-notes \
--notes "Read Immich release notes [here](https://github.com/immich-app/immich/releases/tag/${{ needs.check_new_version.outputs.immich_version }})"
- name: Get base image tag
id: tag
run: |
mkdir /tmp/immich
curl -o \
/tmp/immich.tar.gz -L \
"https://github.com/immich-app/immich/archive/${{ needs.check_new_version.outputs.immich_version }}.tar.gz" && \
tar xf \
/tmp/immich.tar.gz -C \
/tmp/immich --strip-components=1 && \
dockerfile_content=$(cat /tmp/immich/server/Dockerfile)
date=$(echo "$dockerfile_content" | grep -oP 'base-server-prod:\K\d{8}')
if [ -z "$date" ]; then
base_image_tag="latest";
else
base_image_tag="$date";
fi
echo "base_image_tag=${base_image_tag}" >> $GITHUB_OUTPUT
- name: Trigger workflow
if: github.event_name != 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run docker.yml -f version=${{ needs.check_new_version.outputs.immich_version }}
run: gh workflow run docker.yml -f version=${{ needs.check_new_version.outputs.immich_version }} -f base_image_tag=${{ steps.tag.outputs.base_image_tag }}
48 changes: 15 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -19,33 +19,24 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Setup poetry
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "poetry"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install python dependencies
run: poetry install --with dev,test
run: |
uv venv
uv sync
- name: Run python linter
run: poetry run ruff check .
run: uv run ruff check render_templates
if: ${{ !cancelled() }}

- name: Run python formatter
run: poetry run black --check .
run: uv run ruff format --check render_templates
if: ${{ !cancelled() }}

- name: Run tests and coverage
run: poetry run pytest render_templates
run: uv run pytest render_templates
if: ${{ !cancelled() }}

Linter:
@@ -59,25 +50,16 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Install poetry
run: pipx install poetry

- name: Setup poetry
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: "poetry"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Install python dependencies
run: poetry install --without dev,test
run: |
uv venv
uv pip install -r pyproject.toml
- name: Create Dockerfile from template
run: poetry run python3 render_templates/main.py --flavor ${{ matrix.flavor }}
run: uv run python3 -m render_templates.main --flavor ${{ matrix.flavor }}

- name: Run Hadolint
uses: hadolint/hadolint-action@v3.1.0
@@ -113,7 +95,7 @@ jobs:
uses: actions/checkout@v4

- name: Install prettier
run: npm i prettier@3.3.1
run: npm i prettier@3.3.3

- name: Run formatter
run: npx prettier --check .
47 changes: 1 addition & 46 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,50 +1,5 @@
# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msm
*.msp

# Windows shortcuts
*.lnk

# =========================
# Operating System Files
# =========================

# OSX
# =========================

.DS_Store
.AppleDouble
.LSOverride

# Thumbnails
._*

# Files that might appear on external disk
.Spotlight-V100
.Trashes

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# Custom
build-*/
node_modules
package*.json
.venv/
/test/
__pycache__/
Loading