All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m5s
51 lines
1.6 KiB
Diff
51 lines
1.6 KiB
Diff
From 1643aa0d359121729c283e53e4b44a56aed37b02 Mon Sep 17 00:00:00 2001
|
|
From: Fijxu <fijxu@nadeko.net>
|
|
Date: Tue, 15 Apr 2025 19:48:26 -0400
|
|
Subject: [PATCH 15/15] ci: improve container image build times
|
|
|
|
---
|
|
.github/workflows/docker-build-push.yaml | 2 ++
|
|
Dockerfile | 10 ++++++----
|
|
2 files changed, 8 insertions(+), 4 deletions(-)
|
|
|
|
diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml
|
|
index 8a79d77..69561fa 100644
|
|
--- a/.github/workflows/docker-build-push.yaml
|
|
+++ b/.github/workflows/docker-build-push.yaml
|
|
@@ -70,3 +70,5 @@ jobs:
|
|
platforms: linux/amd64,linux/arm64 # Build for multiple architectures
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
+ cache-from: type=gha
|
|
+ cache-to: type=gha,mode=max
|
|
diff --git a/Dockerfile b/Dockerfile
|
|
index 4533e71..bd43ac9 100644
|
|
--- a/Dockerfile
|
|
+++ b/Dockerfile
|
|
@@ -11,9 +11,6 @@ RUN mkdir -p /var/tmp/youtubei.js
|
|
|
|
RUN apt update && apt install -y curl
|
|
|
|
-COPY ./src/ /app/src/
|
|
-COPY deno.json /app/
|
|
-
|
|
RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-$(dpkg --print-architecture) \
|
|
--output /tini \
|
|
&& chmod +x /tini
|
|
@@ -23,7 +20,12 @@ RUN arch=$(uname -m) && \
|
|
--output /thc \
|
|
&& chmod +x /thc
|
|
|
|
-RUN deno task compile
|
|
+COPY deno.json /app/
|
|
+COPY deno.lock /app/
|
|
+
|
|
+COPY ./src/ /app/src/
|
|
+
|
|
+RUN --mount=type=cache,target=/deno-dir deno task compile
|
|
|
|
# Stage for creating the non-privileged user
|
|
FROM alpine:3.20 AS user-stage
|
|
--
|
|
2.49.0
|
|
|