-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.59 KB
/
staging.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Deploy main en Potus WS
on:
push:
branches:
- main
jobs:
build:
runs-on: potus
environment: staging
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build Docker image BACKEND
run: docker build -t ghcr.io/grupo-4-lcs-ungs/back/g4-api-server-dev:latest -f ./Dockerfile-staging .
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker image to GCR BACKEND
run: docker push ghcr.io/grupo-4-lcs-ungs/back/g4-api-server-dev:latest
deploy:
runs-on: potus
environment: staging
needs: build
steps:
- name: Bajar servicio anterior Intento 1
run: docker-compose -f docker-compose-stage.yml -p g4-api down
- name: Bajar servicio anterior Intento 2
run: docker-compose -f docker-compose-stage.yml -p g4-api down
- name: Desplegar en PWS
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_PORT: ${{ secrets.DB_PORT }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_NAME: ${{ secrets.DB_NAME }}
SECRET_KEY: ${{ secrets.APP_SECRET_KEY }}
APP_PORT: ${{ secrets.APP_PORT }}
APP_HOST: ${{ secrets.APP_HOST }}
TRACCAR_API: ${{ secrets.TRACCAR_API }}
ENV: staging
run: docker-compose -f docker-compose-stage.yml -p g4-api up -d