51 lines
1.3 KiB
YAML
51 lines
1.3 KiB
YAML
name: Build and Push (dev)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
paths:
|
|
- '**.py'
|
|
- 'requirements.txt'
|
|
- 'Dockerfile'
|
|
- '.gitea/workflows/**'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.sakamoto.best
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Get short commit SHA
|
|
id: vars
|
|
run: echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
|
|
|
|
- name: Build and push with cache
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
file: Dockerfile
|
|
push: true
|
|
tags: |
|
|
git.sakamoto.best/lolz/auto-stars:${{ steps.vars.outputs.SHORT_SHA }}
|
|
git.sakamoto.best/lolz/auto-stars:dev
|
|
cache-from: type=registry,ref=git.sakamoto.best/lolz/auto-stars:buildcache-dev
|
|
cache-to: type=registry,ref=git.sakamoto.best/lolz/auto-stars:buildcache-dev,mode=max
|
|
provenance: false
|
|
sbom: false
|
|
build-args: |
|
|
BUILDKIT_INLINE_CACHE=1
|