Actualizar .gitea/workflows/ci.yaml
This commit is contained in:
parent
981d6f4e27
commit
eb07818665
@ -28,20 +28,30 @@ jobs:
|
|||||||
|
|
||||||
- name: Run Tests with Coverage
|
- name: Run Tests with Coverage
|
||||||
run: poetry run pytest --cov --cov-report=term-missing --cov-fail-under=80
|
run: poetry run pytest --cov --cov-report=term-missing --cov-fail-under=80
|
||||||
|
|
||||||
publish-container:
|
publish-container:
|
||||||
needs: test-and-lint
|
needs: test-and-lint
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
packages: write
|
||||||
|
contents: read
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- 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
|
- name: Login to Gitea Container Registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
registry: ${{ gitea.server_url }}
|
registry: ${{ steps.meta.outputs.REGISTRY_HOST }}
|
||||||
# Nota: Quita 'https://' si server_url lo incluye y falla, suele ser solo dominio:puerto
|
username: ${{ github.actor }}
|
||||||
username: ${{ gitea.actor }}
|
password: ${{ secrets.PACKAGES_TOKEN }}
|
||||||
password: ${{ secrets.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
|
||||||
@ -49,5 +59,5 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
${{ gitea.server_url }}/${{ gitea.repository }}:latest
|
${{ steps.meta.outputs.REGISTRY_HOST }}/${{ steps.meta.outputs.IMAGE_NAME }}:latest
|
||||||
${{ gitea.server_url }}/${{ gitea.repository }}:${{ gitea.ref_name }}
|
${{ steps.meta.outputs.REGISTRY_HOST }}/${{ steps.meta.outputs.IMAGE_NAME }}:${{ gitea.ref_name }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user