Skip to content

fix-test: checking if the error comes from the env variable def again #2

fix-test: checking if the error comes from the env variable def again

fix-test: checking if the error comes from the env variable def again #2

Workflow file for this run

name: Deploy to Development
on:
push:
branches:
- add_deploy_dev
workflow_dispatch:
jobs:
deploy:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Export environment variables
run: |
export GROUP_ID="05"
export PORT_PREFIX="2"
export DEV_POSTFIX="1"
export STAG_POSTFIX="2"
export PROD_POSTFIX="3"
export GATEWAY_POSTFIX="6"
export DEV_PORT_PREFIX="${PORT_PREFIX}${GROUP_ID}${DEV_POSTFIX}"
export STAG_PORT_PREFIX="${PORT_PREFIX}${GROUP_ID}${STAG_POSTFIX}"
export PROD_PORT_PREFIX="${PORT_PREFIX}${GROUP_ID}${PROD_POSTFIX}"
echo "DEV_PORT_PREFIX=$DEV_PORT_PREFIX" >> $GITHUB_ENV
echo "STAG_PORT_PREFIX=$STAG_PORT_PREFIX" >> $GITHUB_ENV
echo "PROD_PORT_PREFIX=$PROD_PORT_PREFIX" >> $GITHUB_ENV
echo "GATEWAY_POSTFIX=$GATEWAY_POSTFIX" >> $GITHUB_ENV
# - name: Set up environment variables
# uses: falti/dotenv-action@v1.1.4
# with:
# export-variables: true
# keys-case: bypass
# - name: Check environment variables
# run: env
- name: Stop and remove existing containers
run: |
sudo docker compose -f docker-compose.dev.yml down
- name: Build Docker images
run: |
sudo docker compose -f docker-compose.dev.yml build
- name: Run Docker containers
run: |
sudo docker compose -f docker-compose.dev.yml up -d
- name: Check Docker containers
run: |
sudo docker ps
- name: Test app deployment
run: |
sudo curl -s http://localhost:20514 || echo "Backend not accessible" && exit 1
sudo curl -s http://localhost:20515 || echo "Frontend not accessible" && exit 1
sudo curl -s http://localhost:20516 || echo "Gateway not accessible" && exit 1