Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix (CI): Fix frontend deployment #1011

Merged
merged 5 commits into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions .github/workflows/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ jobs:
name: Deploy to test environment
environment: Test
runs-on: tst
if: github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/develop'

# this job runs only on commits to the develop branch or when manually triggered for a branch other than main
if: github.ref == 'refs/heads/develop' || (github.event_name == 'workflow_dispatch' && github.ref != 'refs/heads/main')
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
Expand All @@ -32,6 +34,13 @@ jobs:
FRONTEND_EXPERIMENT_SLUG: ${{ vars.FRONTEND_EXPERIMENT_SLUG }}
FRONTEND_AML_HOME: ${{ vars.FRONTEND_AML_HOME }}
FRONTEND_HTML_PAGE_TITLE: ${{ vars.FRONTEND_HTML_PAGE_TITLE }}
FRONTEND_HTML_FAVICON: ${{ vars.FRONTEND_HTML_FAVICON || '' }}
FRONTEND_LOGO_URL: ${{ vars.FRONTEND_LOGO_URL || '' }}
FRONTEND_HTML_OG_DESCRIPTION: ${{ vars.FRONTEND_HTML_OG_DESCRIPTION || '' }}
FRONTEND_HTML_OG_IMAGE: ${{ vars.FRONTEND_HTML_OG_IMAGE || '' }}
FRONTEND_HTML_OG_TITLE: ${{ vars.FRONTEND_HTML_OG_TITLE || '' }}
FRONTEND_HTML_OG_URL: ${{ vars.FRONTEND_HTML_OG_URL || '' }}
FRONTEND_HTML_BODY_CLASS: ${{ vars.FRONTEND_HTML_BODY_CLASS || '' }}

# Secrets
AML_SECRET_KEY: ${{ secrets.AML_SECRET_KEY }}
Expand All @@ -51,11 +60,18 @@ jobs:
- name: Create .env file
run: |
touch .env
echo "FRONTEND_API_ROOT=$FRONTEND_API_ROOT" >> .env
echo "FRONTEND_EXPERIMENT_SLUG=$FRONTEND_EXPERIMENT_SLUG" >> .env
echo "FRONTEND_AML_HOME=$FRONTEND_AML_HOME" >> .env
echo "FRONTEND_HTML_PAGE_TITLE=$FRONTEND_HTML_PAGE_TITLE" >> .env
echo "FRONTEND_SENTRY_DSN=$FRONTEND_SENTRY_DSN" >> .env
echo "VITE_API_ROOT=$FRONTEND_API_ROOT" >> .env
echo "VITE_EXPERIMENT_SLUG=$FRONTEND_EXPERIMENT_SLUG" >> .env
echo "VITE_AML_HOME=$FRONTEND_AML_HOME" >> .env
echo "VITE_LOGO_URL=$FRONTEND_LOGO_URL" >> .env
echo "VITE_HTML_FAVICON=$FRONTEND_HTML_FAVICON" >> .env
echo "VITE_HTML_PAGE_TITLE=$FRONTEND_HTML_PAGE_TITLE" >> .env
echo "VITE_HTML_OG_DESCRIPTION=$FRONTEND_HTML_OG_DESCRIPTION" >> .env
echo "VITE_HTML_OG_IMAGE=$FRONTEND_HTML_OG_IMAGE" >> .env
echo "VITE_HTML_OG_TITLE=$FRONTEND_HTML_OG_TITLE" >> .env
echo "VITE_HTML_OG_URL=$FRONTEND_HTML_OG_URL" >> .env
echo "VITE_HTML_BODY_CLASS=$FRONTEND_HTML_BODY_CLASS" >> .env
echo "VITE_SENTRY_DSN=$FRONTEND_SENTRY_DSN" >> .env
cp .env frontend/.env
- name: Build Podman images
run: podman-compose -f docker-compose-deploy.yml build
Expand Down Expand Up @@ -86,7 +102,9 @@ jobs:
name: Deploy to acceptance environment
environment: Acceptance
runs-on: ACC
if: github.ref == 'refs/heads/main' || github.ref == 'refs/tags/*'

# this job runs only on commits to the main branch, tags, or when manually triggered for the main branch
if: github.ref == 'refs/heads/main' || github.ref == 'refs/tags/*' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
env:
Expand All @@ -106,6 +124,13 @@ jobs:
FRONTEND_EXPERIMENT_SLUG: ${{ vars.FRONTEND_EXPERIMENT_SLUG }}
FRONTEND_AML_HOME: ${{ vars.FRONTEND_AML_HOME }}
FRONTEND_HTML_PAGE_TITLE: ${{ vars.FRONTEND_HTML_PAGE_TITLE }}
FRONTEND_HTML_FAVICON: ${{ vars.FRONTEND_HTML_FAVICON || '' }}
FRONTEND_LOGO_URL: ${{ vars.FRONTEND_LOGO_URL || '' }}
FRONTEND_HTML_OG_DESCRIPTION: ${{ vars.FRONTEND_HTML_OG_DESCRIPTION || '' }}
FRONTEND_HTML_OG_IMAGE: ${{ vars.FRONTEND_HTML_OG_IMAGE || '' }}
FRONTEND_HTML_OG_TITLE: ${{ vars.FRONTEND_HTML_OG_TITLE || '' }}
FRONTEND_HTML_OG_URL: ${{ vars.FRONTEND_HTML_OG_URL || '' }}
FRONTEND_HTML_BODY_CLASS: ${{ vars.FRONTEND_HTML_BODY_CLASS || '' }}

# Secrets
AML_SECRET_KEY: ${{ secrets.AML_SECRET_KEY }}
Expand All @@ -125,11 +150,18 @@ jobs:
- name: Create .env file
run: |
touch .env
echo "FRONTEND_API_ROOT=$FRONTEND_API_ROOT" >> .env
echo "FRONTEND_EXPERIMENT_SLUG=$FRONTEND_EXPERIMENT_SLUG" >> .env
echo "FRONTEND_AML_HOME=$FRONTEND_AML_HOME" >> .env
echo "FRONTEND_HTML_PAGE_TITLE=$FRONTEND_HTML_PAGE_TITLE" >> .env
echo "FRONTEND_SENTRY_DSN=$FRONTEND_SENTRY_DSN" >> .env
echo "VITE_API_ROOT=$FRONTEND_API_ROOT" >> .env
echo "VITE_EXPERIMENT_SLUG=$FRONTEND_EXPERIMENT_SLUG" >> .env
echo "VITE_AML_HOME=$FRONTEND_AML_HOME" >> .env
echo "VITE_LOGO_URL=$FRONTEND_LOGO_URL" >> .env
echo "VITE_HTML_FAVICON=$FRONTEND_HTML_FAVICON" >> .env
echo "VITE_HTML_PAGE_TITLE=$FRONTEND_HTML_PAGE_TITLE" >> .env
echo "VITE_HTML_OG_DESCRIPTION=$FRONTEND_HTML_OG_DESCRIPTION" >> .env
echo "VITE_HTML_OG_IMAGE=$FRONTEND_HTML_OG_IMAGE" >> .env
echo "VITE_HTML_OG_TITLE=$FRONTEND_HTML_OG_TITLE" >> .env
echo "VITE_HTML_OG_URL=$FRONTEND_HTML_OG_URL" >> .env
echo "VITE_HTML_BODY_CLASS=$FRONTEND_HTML_BODY_CLASS" >> .env
echo "VITE_SENTRY_DSN=$FRONTEND_SENTRY_DSN" >> .env
cp .env frontend/.env
- name: Build Podman images
run: podman-compose -f docker-compose-deploy.yml build
Expand Down
Loading