Files
lambada-fiesta-live/.gitea/workflows/deploy.yaml
T
Antoni Nuñez Romeu a80d72e9e6
CI/CD Deploy / test (push) Successful in 1m2s
CI/CD Deploy / build-push (push) Successful in 1m33s
CI/CD Deploy / deploy (push) Successful in 1m27s
Staff + Airport changes + deployment fixes
2026-08-07 01:32:37 +02:00

61 lines
1.7 KiB
YAML

name: CI/CD Deploy
run-name: ${{ gitea.actor }} is deploying to PROD servers.
on:
push:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Run tests
run: npm test
build-push:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: git.hacecalor.net
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
git.hacecalor.net/ichitux/zlb:latest
git.hacecalor.net/ichitux/zlb:${{ gitea.sha }}
- run: 'echo "Image ${{ gitea.sha }} pushed to registry. Job status: ${{ job.status }}"'
deploy:
needs: build-push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy Swarm stack
run: |
docker login git.hacecalor.net -u ${{ secrets.REGISTRY_USERNAME }} -p ${{ secrets.REGISTRY_PASSWORD }}
docker compose pull
docker stack deploy --with-registry-auth -c docker-compose.yml zlb
docker image prune -f
- run: 'echo "This job status is ${{ job.status }}"'