add COMPOSE_PROJECT_NAME for each workflow

This commit is contained in:
SennayT
2026-05-28 13:01:52 +03:00
parent 342ccb63de
commit f79ff77925
2 changed files with 30 additions and 16 deletions

View File

@@ -6,6 +6,7 @@ on:
- main
- develop
- staging
- feat/improve-buid-pipeline
paths:
- "apps/edr-freight-api/**"
- "apps/edr-freight-web/**"
@@ -45,6 +46,12 @@ jobs:
freight-portal \
freight-backoffice
- name: Set compose project name
run: |
set -euo pipefail
branch_slug=$(echo "${BRANCH}" | tr "[:upper:]" "[:lower:]" | sed -E "s/[^a-z0-9]+/-/g; s/^-+//; s/-+$//")
echo "COMPOSE_PROJECT_NAME=${PROJECT}-${branch_slug}" >> "${GITHUB_ENV}"
- name: Configure npm auth for Docker builds
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -53,18 +60,18 @@ jobs:
- name: Build images
run: |
set -euo pipefail
docker compose build \
docker compose --project-name "${COMPOSE_PROJECT_NAME}" build \
freight-api \
freight-portal \
freight-backoffice
- name: Deploy containers
run: |
set -euo pipefail
docker compose up -d \
freight-api \
freight-portal \
freight-backoffice
# - name: Deploy containers
# run: |
# set -euo pipefail
# docker compose --project-name "${COMPOSE_PROJECT_NAME}" up -d \
# freight-api \
# freight-portal \
# freight-backoffice
- name: Remove npm credentials from workspace
if: always()

View File

@@ -6,6 +6,7 @@ on:
- main
- develop
- staging
- feat/improve-buid-pipeline
paths:
- "apps/edr-passenger-api/**"
- "apps/edr-passenger-web/**"
@@ -45,6 +46,12 @@ jobs:
passenger-portal \
passenger-backoffice
- name: Set compose project name
run: |
set -euo pipefail
branch_slug=$(echo "${BRANCH}" | tr "[:upper:]" "[:lower:]" | sed -E "s/[^a-z0-9]+/-/g; s/^-+//; s/-+$//")
echo "COMPOSE_PROJECT_NAME=${PROJECT}-${branch_slug}" >> "${GITHUB_ENV}"
- name: Configure npm auth for Docker builds
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -53,18 +60,18 @@ jobs:
- name: Build images
run: |
set -euo pipefail
docker compose build \
docker compose --project-name "${COMPOSE_PROJECT_NAME}" build \
passenger-api \
passenger-portal \
passenger-backoffice
- name: Deploy containers
run: |
set -euo pipefail
docker compose up -d \
passenger-api \
passenger-portal \
passenger-backoffice
# - name: Deploy containers
# run: |
# set -euo pipefail
# docker compose --project-name "${COMPOSE_PROJECT_NAME}" up -d \
# passenger-api \
# passenger-portal \
# passenger-backoffice
- name: Remove npm credentials from workspace
if: always()