diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 140fa5de..3277cc40 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -28,6 +28,22 @@ jobs: - uses: https://code.forgejo.org/docker/setup-buildx-action@v3 name: Setup Docker BuildX system + - name: Set up Crystal cache + uses: actions/cache@v4 + id: crystal-cache + with: + path: | + ~/.cache/crystal + lib + invidious + key: ${{ runner.os }}-crystal-${{ hashFiles('**/shard.lock') }} + restore-keys: | + ${{ runner.os }}-crystal- + + - name: Install shards + if: steps.crystal-cache.outputs.cache-hit != 'true' + run: shards check || shards install --production + - name: Login to Docker Container Registry uses: https://code.forgejo.org/docker/login-action@v3.1.0 with: diff --git a/docker/Dockerfile b/docker/Dockerfile index f5f4322d..90039f42 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -21,7 +21,7 @@ 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 --mount=type=cache,target=~/.cache/crystal if [[ "${release}" == 1 ]] ; then \ crystal build ./src/invidious.cr \ --release --mcpu=x86-64-v2 \ --static --warnings all \