CI: Use buildkit-cache-dance to speed up builds

This commit is contained in:
Fijxu 2025-05-24 22:41:21 -04:00
parent c89b7df7d3
commit 0e73ca1923
No known key found for this signature in database
GPG Key ID: 32C1DDF333EDA6A4
2 changed files with 18 additions and 3 deletions

View File

@ -2,8 +2,6 @@ name: "Invidious CI"
on:
workflow_dispatch:
# schedule:
# - cron: '0 7 * * 0'
push:
branches:
- "master"
@ -44,6 +42,23 @@ jobs:
type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
- name: Cache .o files for compilation
uses: https://code.forgejo.org/actions/cache@v4
id: cache
with:
path: |
codegen-cache
key: cache-${{ hashFiles('./Dockerfile') }}
- name: Inject cache into Docker
uses: https://github.com/reproducible-containers/buildkit-cache-dance@v3.1.0
with:
cache-map: |
{
"codegen-cache": "/root/.cache/crystal"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- uses: https://code.forgejo.org/docker/build-push-action@v6
name: Build images
with:

View File

@ -22,7 +22,7 @@ COPY ./videojs-dependencies.yml ./videojs-dependencies.yml
RUN --mount=type=cache,target=/root/.cache/crystal \
crystal build ./src/invidious.cr \
--release --mcpu=x86-64-v2 \
-O3 -Drelease --mcpu=x86-64-v2 \
--static --warnings all \
--link-flags "-lxml2 -llzma";