Skip to content

CI: commit for testing docker cache #33

CI: commit for testing docker cache

CI: commit for testing docker cache #33

name: Build and release container directly from master
on:
push:
branches:
- "master"
paths-ignore:
- "*.md"
- LICENCE
- TRANSLATION
- invidious.service
- .git*
- .editorconfig
- screenshots/*
- .github/ISSUE_TEMPLATE/*
- kubernetes/**
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
id: setup-buildx
- name: Login to registry
uses: docker/login-action@v3
with:
registry: git.nadeko.net
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Cache shards
uses: actions/cache@v4
id: cache
with:
path: |
./lib
./bin
key: docker-shards-${{ hashFiles('shard.lock') }}
- name: Cache crystal build cache (mainly scripts)
uses: actions/cache@v4
id: cache-scripts
with:
path: |
/root/.cache/crystal
key: docker-crystal-${{ hashFiles('./scripts') }}
- name: Restore Docker cache mounts
uses: reproducible-containers/buildkit-cache-dance@v3
with:
builder: ${{ steps.setup-buildx.outputs.name }}
cache-map: |
{
"shards-lib": "/invidious/lib",
"shards-bin": "/invidious/bin",
"scripts-cache": "/root/.cache/crystal"
}
skip-extraction: ${{ steps.cache.outputs.cache-hit }}
- name: Restore Docker cache mounts
uses: reproducible-containers/buildkit-cache-dance@v3
with:
builder: ${{ steps.setup-buildx.outputs.name }}
cache-map: |
{
"scripts-cache": "/root/.cache/crystal"
}
skip-extraction: ${{ steps.cache-scripts.outputs.cache-hit }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: git.nadeko.net/fijxu/invidious_do_not_pull
tags: |
type=sha,format=short,prefix={{date 'YYYY.MM.DD'}}-,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
type=raw,value=master,enable=${{ github.ref == format('refs/heads/{0}', 'master') }}
labels: |
quay.expires-after=12w
- name: Build and push Docker AMD64 image for Push Event
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile
platforms: linux/amd64
labels: ${{ steps.meta.outputs.labels }}
push: true
tags: ${{ steps.meta.outputs.tags }}
build-args: |
"release=1"