bfc7c21559
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 36s
- Specificato permissions: packages: write nei workflow - Necessario per autenticazione al registry Gitea self-hosted
34 lines
962 B
YAML
34 lines
962 B
YAML
name: Docker Image Cleanup
|
|
|
|
on:
|
|
schedule:
|
|
# Esegui ogni domenica alle 2:00 AM
|
|
- cron: '0 2 * * 0'
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
cleanup-old-images:
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master'
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Login to Gitea Container Registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: gitea.home-nas-ds.org
|
|
username: ${{ github.actor }}
|
|
password: ${{ github.token }}
|
|
|
|
- name: Cleanup old development images
|
|
run: |
|
|
echo "Pulizia delle immagini Docker vecchie (mantenere solo le ultime 10 versioni)"
|
|
# Questo script può essere personalizzato in base alle tue esigenze
|
|
# Per ora è solo un placeholder per future implementazioni
|
|
echo "Cleanup completato"
|