-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
740dbf7
commit 5c23d17
Showing
1 changed file
with
65 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ jobs: | |
pre-job: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
should_run_server: ${{ steps.found_paths.outputs.server == 'true' || steps.should_force.outputs.should_force == 'true' }} | ||
should_run_server: ${{ steps.found_paths.outputs.server == 'true' || steps.should_force.outputs.should_force == 'true' || true }} | ||
should_run_ml: ${{ steps.found_paths.outputs.machine-learning == 'true' || steps.should_force.outputs.should_force == 'true' }} | ||
steps: | ||
- name: Checkout code | ||
|
@@ -202,6 +202,8 @@ jobs: | |
image: immich-server | ||
context: . | ||
file: server/Dockerfile | ||
GHCR_REPO: ghcr.io/${{ github.repository_owner }}/immich-server | ||
DOCKER_REPO: altran1502/immich-server | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
|
@@ -213,6 +215,11 @@ jobs: | |
runner: ubuntu-24.04-arm | ||
device: cpu | ||
steps: | ||
- name: Prepare | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
|
@@ -262,11 +269,12 @@ jobs: | |
# Essentially just ignore the cache output (PR can't write to registry cache) | ||
echo "cache-to=type=local,dest=/tmp/discard,ignore-error=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "cache-from=type=registry,ref=ghcr.io/${{ github.repository_owner }}/immich-build-cache:${{env.image}}-${{matrix.platform}}" >> $GITHUB_OUTPUT | ||
echo "cache-to=type=registry,mode=max,ref=ghcr.io/${{ github.repository_owner }}/immich-build-cache:${{ env.image }}-${{matrix.platform}}" >> $GITHUB_OUTPUT | ||
echo "cache-from=type=registry,ref=ghcr.io/${{ github.repository_owner }}/immich-build-cache:${{env.image}}-${{env.PLATFORM_PAIR}}" >> $GITHUB_OUTPUT | ||
echo "cache-to=type=registry,mode=max,ref=ghcr.io/${{ github.repository_owner }}/immich-build-cache:${{ env.image }}-${{env.PLATFORM_PAIR}}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Build and push image | ||
id: build | ||
uses: docker/[email protected] | ||
with: | ||
context: ${{ env.context }} | ||
|
@@ -277,7 +285,7 @@ jobs: | |
cache-from: ${{ steps.cache-target.outputs.cache-from }} | ||
cache-to: ${{ steps.cache-target.outputs.cache-to }} | ||
labels: ${{ steps.metadata.outputs.labels }} | ||
outputs: type=image,"name=altran1502/${{env.image}},ghcr.io/${{ github.repository_owner }}/${{env.image}}",push-by-digest=true,name-canonical=true,push=true | ||
outputs: type=image,"name=ghcr.io/${{ github.repository_owner }}/${{env.image}}",push-by-digest=true,name-canonical=true,push=true | ||
build-args: | | ||
DEVICE=${{ matrix.device }} | ||
BUILD_ID=${{ github.run_id }} | ||
|
@@ -299,59 +307,59 @@ jobs: | |
if-no-files-found: error | ||
retention-days: 1 | ||
|
||
merge: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- name: Download digests | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ${{ runner.temp }}/digests | ||
pattern: digests-* | ||
merge-multiple: true | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to GHCR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ env.DOCKERHUB_REPO }} | ||
${{ env.GHCR_REPO }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Create manifest list and push | ||
working-directory: ${{ runner.temp }}/digests | ||
run: | | ||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *) | ||
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
$(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) | ||
- name: Inspect image | ||
run: | | ||
docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }} | ||
docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }} | ||
# merge: | ||
# runs-on: ubuntu-latest | ||
# needs: | ||
# - build | ||
# steps: | ||
# - name: Download digests | ||
# uses: actions/download-artifact@v4 | ||
# with: | ||
# path: ${{ runner.temp }}/digests | ||
# pattern: digests-* | ||
# merge-multiple: true | ||
# | ||
# - name: Login to Docker Hub | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# username: ${{ vars.DOCKERHUB_USERNAME }} | ||
# password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
# | ||
# - name: Login to GHCR | ||
# uses: docker/login-action@v3 | ||
# with: | ||
# registry: ghcr.io | ||
# username: ${{ github.repository_owner }} | ||
# password: ${{ secrets.GITHUB_TOKEN }} | ||
# | ||
# - name: Set up Docker Buildx | ||
# uses: docker/setup-buildx-action@v3 | ||
# | ||
# - name: Docker meta | ||
# id: meta | ||
# uses: docker/metadata-action@v5 | ||
# with: | ||
# images: | | ||
# ${{ env.DOCKERHUB_REPO }} | ||
# ${{ env.GHCR_REPO }} | ||
# tags: | | ||
# type=ref,event=branch | ||
# type=ref,event=pr | ||
# type=semver,pattern={{version}} | ||
# type=semver,pattern={{major}}.{{minor}} | ||
# | ||
# - name: Create manifest list and push | ||
# working-directory: ${{ runner.temp }}/digests | ||
# run: | | ||
# docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
# $(printf '${{ env.DOCKERHUB_REPO }}@sha256:%s ' *) | ||
# docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \ | ||
# $(printf '${{ env.GHCR_REPO }}@sha256:%s ' *) | ||
# | ||
# - name: Inspect image | ||
# run: | | ||
# docker buildx imagetools inspect ${{ env.DOCKERHUB_REPO }}:${{ steps.meta.outputs.version }} | ||
# docker buildx imagetools inspect ${{ env.GHCR_REPO }}:${{ steps.meta.outputs.version }} | ||
|
||
success-check-server: | ||
name: Docker Build & Push Server Success | ||
|