Files
amigos-app/.gitea/workflows/build-and-deploy.yml
josedario87 089c4124f6
Some checks failed
build-and-deploy / build (push) Successful in 20s
build-and-deploy / deploy (push) Failing after 25s
Add Gitea CI/CD workflow and update compose to use registry image
2025-09-06 17:02:40 -06:00

53 lines
1.7 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: build-and-deploy
on:
push:
branches: [ master ]
jobs:
#───────────────── build & push ─────────────────
build:
runs-on: docker
env:
REG: gitea.nucleoriofrio.com/nucleo000
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: gitea.nucleoriofrio.com
username: nucleo000
password: 7bc7b2fcd283bd6a251bef3ede368b7f897c919d
- name: Build+push amigos-app
run: |
docker build -t $REG/amigos-app:${{ github.sha }} -t $REG/amigos-app:latest .
docker push $REG/amigos-app:${{ github.sha }}
docker push $REG/amigos-app:latest
#───────────────── deploy ─────────────────
deploy:
needs: build
runs-on: docker
env:
REG: gitea.nucleoriofrio.com/nucleo000
steps:
- uses: actions/checkout@v3
- name: Login to registry
run: docker login gitea.nucleoriofrio.com -u nucleo000 -p 7bc7b2fcd283bd6a251bef3ede368b7f897c919d
- name: Info about MongoDB
run: |
echo " MongoDB will be deployed with default credentials"
echo " Database: testdb"
echo " Username: admin"
echo " Password: MongoPass2024!"
- name: Pull fresh images used in compose
run: docker compose pull
- name: Clean up stack
run: docker compose --project-name amigos-app down
- name: Update stack
run: docker compose --project-name amigos-app up -d --remove-orphans --wait