mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
Compare commits
5 Commits
9ea02ed10c
...
11-update-
| Author | SHA1 | Date | |
|---|---|---|---|
| dbd37a8b83 | |||
| f1cbdbce9c | |||
| fa1b9523a1 | |||
| e5fceb886b | |||
| ec7c0cbc7a |
2
.github/workflows/deploy-pr.yaml
vendored
2
.github/workflows/deploy-pr.yaml
vendored
@@ -114,7 +114,7 @@ jobs:
|
|||||||
uninstall:
|
uninstall:
|
||||||
if: github.event.action == 'closed'
|
if: github.event.action == 'closed'
|
||||||
name: Helm uninstall (PR preview)
|
name: Helm uninstall (PR preview)
|
||||||
runs-on: ubuntu-latest
|
runs-on: vhs
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Helm
|
- name: Setup Helm
|
||||||
uses: azure/setup-helm@v4
|
uses: azure/setup-helm@v4
|
||||||
|
|||||||
4
.github/workflows/deploy-prod.yaml
vendored
4
.github/workflows/deploy-prod.yaml
vendored
@@ -5,9 +5,11 @@ on:
|
|||||||
branches: [ "main" ]
|
branches: [ "main" ]
|
||||||
paths:
|
paths:
|
||||||
- 7project/backend/**
|
- 7project/backend/**
|
||||||
|
- 7project/frontend/**
|
||||||
- 7project/charts/myapp-chart/**
|
- 7project/charts/myapp-chart/**
|
||||||
- .github/workflows/deploy-prod.yaml
|
- .github/workflows/deploy-prod.yaml
|
||||||
- .github/workflows/build-image.yaml
|
- .github/workflows/build-image.yaml
|
||||||
|
- .github/workflows/frontend-pages.yml
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ jobs:
|
|||||||
deploy:
|
deploy:
|
||||||
name: Helm upgrade/install (prod)
|
name: Helm upgrade/install (prod)
|
||||||
runs-on: vhs
|
runs-on: vhs
|
||||||
needs: [build]
|
needs: [build, frontend]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
37
.github/workflows/frontend-pages.yml
vendored
37
.github/workflows/frontend-pages.yml
vendored
@@ -60,21 +60,40 @@ jobs:
|
|||||||
EVENT_NAME: ${{ github.event_name }}
|
EVENT_NAME: ${{ github.event_name }}
|
||||||
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
|
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
|
||||||
PR_TEMPLATE: ${{ vars.BACKEND_URL_PR_TEMPLATE }}
|
PR_TEMPLATE: ${{ vars.BACKEND_URL_PR_TEMPLATE }}
|
||||||
PROD_DOMAIN: ${{ vars.PROD_DOMAIN }}
|
DEV_BASE_DOMAIN: ${{ secrets.BASE_DOMAIN }}
|
||||||
|
PROD_DOMAIN_VAR: ${{ vars.PROD_DOMAIN }}
|
||||||
|
PROD_DOMAIN_SECRET: ${{ secrets.PROD_DOMAIN }}
|
||||||
|
BACKEND_URL_OVERRIDE: ${{ vars.BACKEND_URL || secrets.BACKEND_URL }}
|
||||||
MODE: ${{ inputs.mode }}
|
MODE: ${{ inputs.mode }}
|
||||||
run: |
|
run: |
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
URL=""
|
URL=""
|
||||||
if [ -n "${PROD_DOMAIN:-}" ]; then
|
# 1) Explicit override wins (from repo var or secret)
|
||||||
if echo "$PROD_DOMAIN" | grep -Eiq '^https?://'; then
|
if [ -n "${BACKEND_URL_OVERRIDE:-}" ]; then
|
||||||
URL="$PROD_DOMAIN"
|
if echo "$BACKEND_URL_OVERRIDE" | grep -Eiq '^https?://'; then
|
||||||
|
URL="$BACKEND_URL_OVERRIDE"
|
||||||
else
|
else
|
||||||
URL="https://${PROD_DOMAIN}"
|
URL="https://${BACKEND_URL_OVERRIDE}"
|
||||||
fi
|
fi
|
||||||
fi
|
else
|
||||||
if [ "${MODE:-}" = "pr" ] || [ "${EVENT_NAME}" = "pull_request" ]; then
|
# 2) PR-specific URL when building for PR
|
||||||
if [ -n "${PR_TEMPLATE:-}" ] && [ -n "${PR_NUMBER:-}" ] ; then
|
if [ "${MODE:-}" = "pr" ] || [ "${EVENT_NAME}" = "pull_request" ]; then
|
||||||
URL="${PR_TEMPLATE//\{PR\}/${PR_NUMBER}}"
|
if [ -n "${PR_TEMPLATE:-}" ] && [ -n "${PR_NUMBER:-}" ] ; then
|
||||||
|
URL="${PR_TEMPLATE//\{PR\}/${PR_NUMBER}}"
|
||||||
|
elif [ -n "${DEV_BASE_DOMAIN:-}" ] && [ -n "${PR_NUMBER:-}" ]; then
|
||||||
|
URL="https://pr-${PR_NUMBER}.${DEV_BASE_DOMAIN}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
# 3) Fallback to PROD_DOMAIN (prefer repo var, then secret)
|
||||||
|
if [ -z "$URL" ]; then
|
||||||
|
PROD_DOMAIN="${PROD_DOMAIN_VAR:-${PROD_DOMAIN_SECRET:-}}"
|
||||||
|
if [ -n "$PROD_DOMAIN" ]; then
|
||||||
|
if echo "$PROD_DOMAIN" | grep -Eiq '^https?://'; then
|
||||||
|
URL="$PROD_DOMAIN"
|
||||||
|
else
|
||||||
|
URL="https://${PROD_DOMAIN}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "Using backend URL: ${URL:-<empty>}"
|
echo "Using backend URL: ${URL:-<empty>}"
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ worker:
|
|||||||
# Queue name for Celery worker and for CRD Queue
|
# Queue name for Celery worker and for CRD Queue
|
||||||
mailQueueName: "mail_queue"
|
mailQueueName: "mail_queue"
|
||||||
|
|
||||||
|
|
||||||
service:
|
service:
|
||||||
port: 80
|
port: 80
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user