High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
build(server): use github-action cache (#949)
Jason Rasmussencc61729f0190
diff --git a/.github/workflows/build_push_docker_latest.yml b/.github/workflows/build_push_docker_latest.ymlindex 94498af0ec..98a6821037 100644--- a/.github/workflows/build_push_docker_latest.yml+++ b/.github/workflows/build_push_docker_latest.yml@@ -33,6 +33,8 @@ jobs:file: ./server/Dockerfileplatforms: linux/arm/v7,linux/amd64,linux/arm64push: true+ cache-from: type=gha+ cache-to: type=gha,mode=maxtags: |altran1502/immich-server:latest@@ -61,6 +63,8 @@ jobs:file: ./machine-learning/Dockerfileplatforms: linux/arm/v7,linux/amd64,linux/arm64push: true+ cache-from: type=gha+ cache-to: type=gha,mode=maxtags: |altran1502/immich-machine-learning:latestdiff --git a/.github/workflows/build_push_docker_staging.yml b/.github/workflows/build_push_docker_staging.ymlindex 24c8033292..08e82e6230 100644--- a/.github/workflows/build_push_docker_staging.yml+++ b/.github/workflows/build_push_docker_staging.yml@@ -34,6 +34,8 @@ jobs:file: ./server/Dockerfileplatforms: linux/arm/v7,linux/amd64,linux/arm64push: ${{ github.event_name == 'pull_request' && github.repository == 'immich-app/immich' }}+ cache-from: type=gha+ cache-to: type=gha,mode=maxtags: |altran1502/immich-server:stagingaltran1502/immich-server:${{ github.event.pull_request.number }}@@ -64,6 +66,8 @@ jobs:file: ./machine-learning/Dockerfileplatforms: linux/arm/v7,linux/amd64,linux/arm64push: ${{ github.event_name == 'pull_request' && github.repository == 'immich-app/immich' }}+ cache-from: type=gha+ cache-to: type=gha,mode=maxtags: |altran1502/immich-machine-learning:stagingaltran1502/immich-machine-learning:${{ github.event.pull_request.number }}diff --git a/.github/workflows/build_push_server_release.yml b/.github/workflows/build_push_server_release.ymlindex 7668c82639..30ffadab02 100644--- a/.github/workflows/build_push_server_release.yml+++ b/.github/workflows/build_push_server_release.yml@@ -12,12 +12,12 @@ jobs:- name: Checkoutuses: actions/checkout@v3with:- ref: "main"+ ref: 'main'fetch-depth: 0- - name: "Get Previous tag"+ - name: 'Get Previous tag'id: previoustag- uses: "WyriHaximus/github-action-get-previous-tag@v1"+ uses: 'WyriHaximus/github-action-get-previous-tag@v1'with:fallback: latest@@ -41,6 +41,8 @@ jobs:file: ./server/Dockerfileplatforms: linux/arm/v7,linux/amd64,linux/arm64push: ${{ github.event_name != 'pull_request' }}+ cache-from: type=gha+ cache-to: type=gha,mode=maxtags: |altran1502/immich-server:${{ steps.previoustag.outputs.tag }}altran1502/immich-server:release@@ -52,9 +54,9 @@ jobs:uses: actions/checkout@v3with:fetch-depth: 0- - name: "Get Previous tag"+ - name: 'Get Previous tag'id: previoustag- uses: "WyriHaximus/github-action-get-previous-tag@v1"+ uses: 'WyriHaximus/github-action-get-previous-tag@v1'with:fallback: latest- name: Set up QEMU@@ -74,6 +76,8 @@ jobs:file: ./machine-learning/Dockerfileplatforms: linux/arm/v7,linux/amd64,linux/arm64push: true+ cache-from: type=gha+ cache-to: type=gha,mode=maxtags: |altran1502/immich-machine-learning:${{ steps.previoustag.outputs.tag }}altran1502/immich-machine-learning:release@@ -84,12 +88,12 @@ jobs:- name: Checkoutuses: actions/checkout@v3with:- ref: "main"+ ref: 'main'fetch-depth: 0- - name: "Get Previous tag"+ - name: 'Get Previous tag'id: previoustag- uses: "WyriHaximus/github-action-get-previous-tag@v1"+ uses: 'WyriHaximus/github-action-get-previous-tag@v1'with:fallback: latest@@ -124,12 +128,12 @@ jobs:- name: Checkoutuses: actions/checkout@v3with:- ref: "main"+ ref: 'main'fetch-depth: 0- - name: "Get Previous tag"+ - name: 'Get Previous tag'id: previoustag- uses: "WyriHaximus/github-action-get-previous-tag@v1"+ uses: 'WyriHaximus/github-action-get-previous-tag@v1'with:fallback: latestdiff --git a/docker/docker-compose.test.yml b/docker/docker-compose.test.ymlindex 03220f04e6..8b4c8fe23f 100644--- a/docker/docker-compose.test.yml+++ b/docker/docker-compose.test.yml@@ -1,4 +1,4 @@-version: "3.8"+version: '3.8'services:immich-server-test:@@ -7,9 +7,9 @@ services:context: ../serverdockerfile: Dockerfiletarget: builder- command: npm run test:e2e+ command: npm ci && npm run test:e2eexpose:- - "3000"+ - '3000'volumes:- ../server:/usr/src/app- /usr/src/app/node_modulesdiff --git a/machine-learning/Dockerfile b/machine-learning/Dockerfileindex b19813c234..f10ccd0c13 100644--- a/machine-learning/Dockerfile+++ b/machine-learning/Dockerfile@@ -6,18 +6,18 @@ ARG DEBIAN_FRONTEND=noninteractiveWORKDIR /usr/src/app-COPY package.json package-lock.json ./-RUN apt-get updateRUN apt-get install gcc g++ make cmake python3 python3-pip ffmpeg -y+COPY package.json package-lock.json ./+RUN npm ciRUN npm rebuild @tensorflow/tfjs-node --build-from-sourceCOPY . .RUN npm run build-+RUN npm prune --omit=dev# Prod stageFROM node:16-bullseye-slim@@ -26,18 +26,14 @@ ARG DEBIAN_FRONTEND=noninteractiveWORKDIR /usr/src/app-COPY package.json package-lock.json ./-COPY entrypoint.sh ./--RUN mkdir -p /usr/src/app/dist \- && mkdir -p /usr/src/app/node_modules \- && apt-get update \+RUN apt-get update \&& apt-get install -y ffmpeg \&& rm -rf /var/cache/apt/listsCOPY --from=builder /usr/src/app/node_modules ./node_modulesCOPY --from=builder /usr/src/app/dist ./dist-RUN npm prune --production+COPY package.json package-lock.json ./+COPY entrypoint.sh ./-# CMD [ "node", "dist/main" ]\ No newline at end of file+# CMD [ "node", "dist/main" ]diff --git a/server/Dockerfile b/server/Dockerfileindex f2d4440836..5c33b794a6 100644--- a/server/Dockerfile+++ b/server/Dockerfile@@ -2,33 +2,32 @@ FROM node:16-alpine3.14 as builderWORKDIR /usr/src/app+RUN apk add --update-cache build-base python3 libheif vips-dev ffmpeg+COPY package.json package-lock.json ./-RUN apk add --update-cache build-base python3 libheif vips-dev ffmpegRUN npm ciCOPY . .RUN npm run build+RUN npm prune --omit=dev# Prod stageFROM node:16-alpine3.14WORKDIR /usr/src/app-COPY LICENSE /licenses/LICENSE.txt-COPY LICENSE /LICENSE--COPY package.json package-lock.json ./-COPY start-server.sh start-microservices.sh ./-RUN mkdir -p /usr/src/app/dist \- && apk add --no-cache libheif vips ffmpeg+RUN apk add --no-cache libheif vips ffmpegCOPY --from=builder /usr/src/app/node_modules ./node_modulesCOPY --from=builder /usr/src/app/dist ./distCOPY --from=builder /usr/src/app/bin ./bin-RUN npm prune --production+COPY LICENSE /licenses/LICENSE.txt+COPY LICENSE /LICENSE+COPY package.json package-lock.json ./+COPY start-server.sh start-microservices.sh ./VOLUME /usr/src/app/upload