diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 140fa5de..6f9a5a04 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -52,5 +52,7 @@ jobs: tags: ${{ steps.meta.outputs.tags }} platforms: linux/amd64 push: true + cache-from: type=gha + cache-to: type=gha,mode=max build-args: | "release=1" diff --git a/docker/Dockerfile b/docker/Dockerfile index f5f4322d..aa881c59 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -7,6 +7,7 @@ ARG release WORKDIR /invidious COPY ./shard.yml ./shard.yml COPY ./shard.lock ./shard.lock + RUN shards install --production COPY ./src/ ./src/ @@ -19,9 +20,17 @@ COPY ./scripts/ ./scripts/ COPY ./assets/ ./assets/ COPY ./videojs-dependencies.yml ./videojs-dependencies.yml -RUN crystal spec --warnings all \ - --link-flags "-lxml2 -llzma" -RUN --mount=type=cache,target=/root/.cache/crystal if [[ "${release}" == 1 ]] ; then \ +RUN crystal build ./scripts/minify-js.cr \ + --release --mcpu=x86-64-v2 \ + --static \ + --link-flags "-lxml2 -llzma"; \ + +RUN crystal build ./scripts/fetch-player-dependencies.cr \ + --release --mcpu=x86-64-v2 \ + --static \ + --link-flags "-lxml2 -llzma"; \ + +RUN if [[ "${release}" == 1 ]] ; then \ crystal build ./src/invidious.cr \ --release --mcpu=x86-64-v2 \ --static --warnings all \