Separate Docker workflows by branch and remove push on non-release branches
Agent-Logs-Url: https://github.com/dsaub/proyecto-final/sessions/3c214772-f4aa-46da-8791-a049cb3ca666 Co-authored-by: dsaub <54474838+dsaub@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
1b872f1905
commit
03399077d0
@@ -0,0 +1,46 @@
|
|||||||
|
name: Build Docker Image (No Push)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches-ignore:
|
||||||
|
- development
|
||||||
|
- latest
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout del código
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
- name: Configurar Python
|
||||||
|
uses: actions/setup-python@v6
|
||||||
|
with:
|
||||||
|
python-version: '3.14'
|
||||||
|
- name: Instalar dependencias
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
- name: Ejecutar tests
|
||||||
|
env:
|
||||||
|
DJANGO_SETTINGS_MODULE: proyecto.settings
|
||||||
|
run: |
|
||||||
|
python manage.py test
|
||||||
|
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: test
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout del código
|
||||||
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
|
- name: Configurar Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v4
|
||||||
|
|
||||||
|
- name: Build (sin push)
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: false
|
||||||
@@ -3,7 +3,8 @@ name: Build and Push Docker Image
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- '**' # Esto aplica para cualquier rama
|
- development
|
||||||
|
- latest
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
|||||||
Reference in New Issue
Block a user