54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: build-and-push
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: docker
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v2
|
|
|
|
- name: Login to registry
|
|
uses: docker/login-action@v2
|
|
with:
|
|
registry: gitea.interno.com
|
|
username: nucleo000
|
|
password: 7bc7b2fcd283bd6a251bef3ede368b7f897c919d
|
|
|
|
- name: Build mcp-prueba image
|
|
run: |
|
|
docker build -f ./Dockerfile \
|
|
-t gitea.interno.com/nucleo000/mcp-prueba:${{ github.sha }} \
|
|
-t gitea.interno.com/nucleo000/mcp-prueba:latest .
|
|
|
|
- name: Push mcp-prueba image
|
|
run: |
|
|
docker push gitea.interno.com/nucleo000/mcp-prueba:${{ github.sha }}
|
|
docker push gitea.interno.com/nucleo000/mcp-prueba:latest
|
|
|
|
deploy:
|
|
runs-on: docker
|
|
needs: build
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Login to registry
|
|
run: |
|
|
echo "Logging into registry…"
|
|
docker login gitea.interno.com -u nucleo000 -p 7bc7b2fcd283bd6a251bef3ede368b7f897c919d
|
|
|
|
- name: Pull latest image
|
|
run: docker pull gitea.interno.com/nucleo000/mcp-prueba:latest
|
|
|
|
- name: Run mcp-prueba
|
|
run: |
|
|
docker rm -f mcp-prueba || true
|
|
docker run -d --name mcp-prueba gitea.interno.com/nucleo000/mcp-prueba:latest
|