Improve main branch workflow: add path filter + registry layer caching for faster builds
Build and Push (main) / build (push) Successful in 43s
Build and Push (dev) / build (push) Successful in 42s

This commit is contained in:
2026-07-30 00:22:11 +00:00
parent f724f8056f
commit 64649a5b26
+10 -1
View File
@@ -4,6 +4,11 @@ on:
push:
branches:
- main
paths:
- '**.py'
- 'requirements.txt'
- 'Dockerfile'
- '.gitea/workflows/**'
jobs:
build:
@@ -26,7 +31,7 @@ jobs:
id: vars
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Build and push Docker image
- name: Build and push with cache
uses: docker/build-push-action@v5
with:
context: .
@@ -35,3 +40,7 @@ jobs:
tags: |
git.sakamoto.best/lolz/auto-stars:${{ steps.vars.outputs.SHORT_SHA }}
git.sakamoto.best/lolz/auto-stars:latest
cache-from: type=registry,ref=git.sakamoto.best/lolz/auto-stars:buildcache
cache-to: type=registry,ref=git.sakamoto.best/lolz/auto-stars:buildcache,mode=max
build-args: |
BUILDKIT_INLINE_CACHE=1