mirror of
https://git.nadeko.net/Fijxu/invidious.git
synced 2025-06-27 17:38:25 +00:00
CI: Use buildkit-cache-dance to speed up builds
This commit is contained in:
parent
c89b7df7d3
commit
0e73ca1923
@ -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:
|
||||
|
@ -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";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user