Correggi workflow Gitea Actions per usare registry self-hosted
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 39s
Build Docker Image for Raspberry Pi / build-and-push (push) Failing after 39s
- Modificato docker-build.yml per usare gitea.home-nas-ds.org invece di Docker Hub - Modificato docker-cleanup.yml per autenticazione con registry Gitea - Usato github.token automatico invece di secrets esterni - Aggiornata documentazione per riflettere i cambiamenti
This commit is contained in:
@@ -34,7 +34,7 @@ jobs:
|
|||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v4
|
||||||
with:
|
with:
|
||||||
images: |
|
images: |
|
||||||
${{ secrets.DOCKER_USERNAME }}/ha-voltronic-mqtt
|
gitea.home-nas-ds.org/${{ github.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
@@ -42,12 +42,13 @@ jobs:
|
|||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=raw,value=latest,enable={{is_default_branch}}
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Gitea Container Registry
|
||||||
if: github.event_name != 'pull_request'
|
if: github.event_name != 'pull_request'
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
registry: gitea.home-nas-ds.org
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ github.token }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v4
|
||||||
|
|||||||
@@ -15,11 +15,12 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Gitea Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
registry: gitea.home-nas-ds.org
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ github.token }}
|
||||||
|
|
||||||
- name: Cleanup old development images
|
- name: Cleanup old development images
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -373,14 +373,17 @@ automation:
|
|||||||
|
|
||||||
### Workflows
|
### Workflows
|
||||||
|
|
||||||
1. **docker-build.yml** - Build e push multi-arch su tag/push
|
1. **docker-build.yml** - Build e push multi-arch su Gitea Registry
|
||||||
2. **docker-test.yml** - Test build su PR
|
2. **docker-test.yml** - Test build su PR
|
||||||
3. **docker-cleanup.yml** - Pulizia immagini vecchie (schedulato)
|
3. **docker-cleanup.yml** - Pulizia immagini vecchie (schedulato)
|
||||||
|
|
||||||
### Secrets Richiesti
|
### Autenticazione
|
||||||
|
|
||||||
- `DOCKER_USERNAME`
|
Gitea Actions usa automaticamente `${{ github.token }}` per autenticarsi al registry interno. Non sono necessari secrets esterni.
|
||||||
- `DOCKER_PASSWORD`
|
|
||||||
|
### Registry
|
||||||
|
|
||||||
|
Le immagini Docker vengono pubblicate su: `gitea.home-nas-ds.org/<username>/<repository>:tag`
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user