mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
add COMPOSE_PROJECT_NAME for each workflow
This commit is contained in:
23
.github/workflows/deploy-freight.yml
vendored
23
.github/workflows/deploy-freight.yml
vendored
@@ -6,6 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
- staging
|
- staging
|
||||||
|
- feat/improve-buid-pipeline
|
||||||
paths:
|
paths:
|
||||||
- "apps/edr-freight-api/**"
|
- "apps/edr-freight-api/**"
|
||||||
- "apps/edr-freight-web/**"
|
- "apps/edr-freight-web/**"
|
||||||
@@ -45,6 +46,12 @@ jobs:
|
|||||||
freight-portal \
|
freight-portal \
|
||||||
freight-backoffice
|
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
|
- name: Configure npm auth for Docker builds
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
@@ -53,18 +60,18 @@ jobs:
|
|||||||
- name: Build images
|
- name: Build images
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
docker compose build \
|
docker compose --project-name "${COMPOSE_PROJECT_NAME}" build \
|
||||||
freight-api \
|
freight-api \
|
||||||
freight-portal \
|
freight-portal \
|
||||||
freight-backoffice
|
freight-backoffice
|
||||||
|
|
||||||
- name: Deploy containers
|
# - name: Deploy containers
|
||||||
run: |
|
# run: |
|
||||||
set -euo pipefail
|
# set -euo pipefail
|
||||||
docker compose up -d \
|
# docker compose --project-name "${COMPOSE_PROJECT_NAME}" up -d \
|
||||||
freight-api \
|
# freight-api \
|
||||||
freight-portal \
|
# freight-portal \
|
||||||
freight-backoffice
|
# freight-backoffice
|
||||||
|
|
||||||
- name: Remove npm credentials from workspace
|
- name: Remove npm credentials from workspace
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
23
.github/workflows/deploy-passenger.yml
vendored
23
.github/workflows/deploy-passenger.yml
vendored
@@ -6,6 +6,7 @@ on:
|
|||||||
- main
|
- main
|
||||||
- develop
|
- develop
|
||||||
- staging
|
- staging
|
||||||
|
- feat/improve-buid-pipeline
|
||||||
paths:
|
paths:
|
||||||
- "apps/edr-passenger-api/**"
|
- "apps/edr-passenger-api/**"
|
||||||
- "apps/edr-passenger-web/**"
|
- "apps/edr-passenger-web/**"
|
||||||
@@ -45,6 +46,12 @@ jobs:
|
|||||||
passenger-portal \
|
passenger-portal \
|
||||||
passenger-backoffice
|
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
|
- name: Configure npm auth for Docker builds
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
@@ -53,18 +60,18 @@ jobs:
|
|||||||
- name: Build images
|
- name: Build images
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
docker compose build \
|
docker compose --project-name "${COMPOSE_PROJECT_NAME}" build \
|
||||||
passenger-api \
|
passenger-api \
|
||||||
passenger-portal \
|
passenger-portal \
|
||||||
passenger-backoffice
|
passenger-backoffice
|
||||||
|
|
||||||
- name: Deploy containers
|
# - name: Deploy containers
|
||||||
run: |
|
# run: |
|
||||||
set -euo pipefail
|
# set -euo pipefail
|
||||||
docker compose up -d \
|
# docker compose --project-name "${COMPOSE_PROJECT_NAME}" up -d \
|
||||||
passenger-api \
|
# passenger-api \
|
||||||
passenger-portal \
|
# passenger-portal \
|
||||||
passenger-backoffice
|
# passenger-backoffice
|
||||||
|
|
||||||
- name: Remove npm credentials from workspace
|
- name: Remove npm credentials from workspace
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
Reference in New Issue
Block a user