Files
nadeko_invidious/.forgejo/workflows/ci.yml

72 lines
2.0 KiB
YAML

name: "Invidious CI"
on:
workflow_dispatch:
push:
branches:
- "master"
paths-ignore:
- "*.md"
- LICENCE
- TRANSLATION
- invidious.service
- .git*
- .editorconfig
- screenshots/*
- .github/ISSUE_TEMPLATE/*
- kubernetes/**
jobs:
build:
runs-on: runner
steps:
- uses: https://code.forgejo.org/actions/checkout@v4
- uses: https://code.forgejo.org/docker/setup-buildx-action@v3
name: Setup Docker BuildX system
- name: Login to Docker Container Registry
uses: https://code.forgejo.org/docker/login-action@v3.4.0
with:
registry: git.nadeko.net
username: ${{ secrets.USERNAME }}
password: ${{ secrets.TOKEN }}
- name: Docker meta
id: meta
uses: https://github.com/docker/metadata-action@v5
with:
images: git.nadeko.net/fijxu/invidious
tags: |
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:
context: .
file: docker/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64
push: true
cache-from: type=gha
cache-to: type=gha,mode=max