Improve dev branch workflow: add path filter + registry layer caching for faster builds
Build and Push (main) / build (push) Successful in 6m45s
Build and Push (main) / build (push) Successful in 6m45s
This commit is contained in:
@@ -4,6 +4,11 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
|
paths:
|
||||||
|
- '**.py'
|
||||||
|
- 'requirements.txt'
|
||||||
|
- 'Dockerfile'
|
||||||
|
- '.gitea/workflows/**'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -26,7 +31,7 @@ jobs:
|
|||||||
id: vars
|
id: vars
|
||||||
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
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
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
@@ -35,3 +40,7 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
git.sakamoto.best/lolz/auto-stars:${{ steps.vars.outputs.SHORT_SHA }}
|
git.sakamoto.best/lolz/auto-stars:${{ steps.vars.outputs.SHORT_SHA }}
|
||||||
git.sakamoto.best/lolz/auto-stars:dev
|
git.sakamoto.best/lolz/auto-stars:dev
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user