generated from unai/python_boilerplate
Refactor CI workflow to use dynamic registry host and image name for Docker publishing
All checks were successful
All checks were successful
This commit is contained in:
parent
f12e9ac547
commit
d2d8546a42
@ -28,19 +28,25 @@ jobs:
|
||||
|
||||
- name: Run Tests with Coverage
|
||||
run: poetry run pytest --cov --cov-report=term-missing --cov-fail-under=80
|
||||
|
||||
|
||||
publish-container:
|
||||
needs: test-and-lint
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Prepare Docker Metadata
|
||||
id: meta
|
||||
run: |
|
||||
echo "REGISTRY_HOST=${GITEA_SERVER_URL#*://}" >> $GITHUB_OUTPUT
|
||||
echo "IMAGE_NAME=$(echo ${{ gitea.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
|
||||
env:
|
||||
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ${{ gitea.server_url }}
|
||||
# Nota: Quita 'https://' si server_url lo incluye y falla, suele ser solo dominio:puerto
|
||||
registry: ${{ steps.meta.outputs.REGISTRY_HOST }}
|
||||
username: ${{ gitea.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
@ -50,5 +56,5 @@ jobs:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ gitea.server_url }}/${{ gitea.repository }}:latest
|
||||
${{ gitea.server_url }}/${{ gitea.repository }}:${{ gitea.ref_name }}
|
||||
${{ steps.meta.outputs.REGISTRY_HOST }}/${{ steps.meta.outputs.IMAGE_NAME }}:latest
|
||||
${{ steps.meta.outputs.REGISTRY_HOST }}/${{ steps.meta.outputs.IMAGE_NAME }}:${{ gitea.ref_name }}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user