48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Build and Push Docker Image to Gitea
|
|
|
|
on:
|
|
push:
|
|
schedule:
|
|
- cron: '0 19 * * *' # Daily at 2 AM UTC
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Gitea
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: gitea.psi.ch
|
|
username: ${{ github.repository_owner }}
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v6
|
|
with:
|
|
# list of Docker images to use as base name for tags
|
|
images: gitea.psi.ch/images/claude-code
|
|
# generate Docker tags based on the following events/attributes
|
|
tags: |
|
|
type=schedule,pattern={{date 'YYYYMMDD'}}
|
|
latest
|
|
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
push: true
|
|
addLatest: true
|
|
addTimestamp: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }} |