listo para deploy en gitea
This commit is contained in:
54
.gitea/workflows/build-and-deploy.yml
Normal file
54
.gitea/workflows/build-and-deploy.yml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
name: build-and-deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
|
||||||
|
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 radiusNucleo
|
||||||
|
run: |
|
||||||
|
docker build -t $REG/radiusNucleo:${{ github.sha }} -t $REG/radiusNucleo:latest ./node-api
|
||||||
|
docker push $REG/radiusNucleo:${{ github.sha }}
|
||||||
|
docker push $REG/radiusNucleo:latest
|
||||||
|
|
||||||
|
#───────────────── deploy ─────────────────
|
||||||
|
deploy:
|
||||||
|
needs: build
|
||||||
|
runs-on: docker
|
||||||
|
env:
|
||||||
|
REG: gitea.nucleoriofrio.com/nucleo000
|
||||||
|
RADIUS_CLIENTS_CIDR: 192.168.87.0/24
|
||||||
|
RADIUS_SHARED_SECRET: tamosbien
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Login to registry
|
||||||
|
run: docker login gitea.nucleoriofrio.com -u nucleo000 -p 7bc7b2fcd283bd6a251bef3ede368b7f897c919d
|
||||||
|
|
||||||
|
- name: Ensure external docker network exists
|
||||||
|
run: |
|
||||||
|
docker network inspect principal >/dev/null 2>&1 || docker network create principal
|
||||||
|
|
||||||
|
- name: Pull fresh images used in compose
|
||||||
|
run: docker compose pull
|
||||||
|
|
||||||
|
- name: Clean up stack
|
||||||
|
run: docker compose --project-name radiusNucleo down
|
||||||
|
|
||||||
|
- name: Update stack
|
||||||
|
run: docker compose --project-name radiusNucleo up -d --remove-orphans --wait
|
||||||
|
|
||||||
@@ -3,6 +3,7 @@ version: "3.9"
|
|||||||
services:
|
services:
|
||||||
node:
|
node:
|
||||||
build: ./node-api
|
build: ./node-api
|
||||||
|
image: gitea.nucleoriofrio.com/nucleo000/radiusNucleo:latest
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
environment:
|
environment:
|
||||||
@@ -17,12 +18,9 @@ services:
|
|||||||
- PGDATABASE=radius
|
- PGDATABASE=radius
|
||||||
- PGUSER=radius
|
- PGUSER=radius
|
||||||
- PGPASSWORD=radius
|
- PGPASSWORD=radius
|
||||||
volumes:
|
|
||||||
- ./node-api/index.js:/app/index.js:ro
|
|
||||||
- ./node-api/src:/app/src:ro
|
|
||||||
- ./frontend/dist:/app/public:ro
|
|
||||||
networks:
|
networks:
|
||||||
- radius_net
|
- radius_net
|
||||||
|
- principal
|
||||||
|
|
||||||
freeradius:
|
freeradius:
|
||||||
image: freeradius/freeradius-server:3.2.2
|
image: freeradius/freeradius-server:3.2.2
|
||||||
@@ -48,6 +46,7 @@ services:
|
|||||||
command: ["-X"]
|
command: ["-X"]
|
||||||
networks:
|
networks:
|
||||||
- radius_net
|
- radius_net
|
||||||
|
- principal
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
@@ -62,10 +61,13 @@ services:
|
|||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
networks:
|
networks:
|
||||||
- radius_net
|
- radius_net
|
||||||
|
- principal
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
radius_net:
|
radius_net:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
principal:
|
||||||
|
external: true
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
|||||||
Reference in New Issue
Block a user