Skip to content

Commit

Permalink
push new var to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Administrator committed Dec 12, 2024
1 parent d6ebc04 commit 9ef479e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/actions/build-frontend/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
shell: bash
working-directory: ${{ inputs.frontend-path }}
run: |
VITE_API_URL=${{ inputs.api-endpoint }} npm run build
MIDDLEWARE_API_URL=${{ inputs.api-endpoint }} npm run build
- name: Test frontend
shell: bash
working-directory: ${{ inputs.frontend-path }}
Expand Down
36 changes: 19 additions & 17 deletions .github/workflows/build-deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
name: Build and Deploy Frontend

on:
workflow_dispatch:
inputs:
deploy-env:
description: 'The environment to deploy to'
required: true
type: choice
options:
- dev
- demo
storage-account-name:
description: 'After the demo env gets created, copy its blob storage name here'
required: false
push:
branches: test-deploy-middleware
# workflow_dispatch:
# inputs:
# deploy-env:
# description: 'The environment to deploy to'
# required: true
# type: choice
# options:
# - dev
# - demo
# storage-account-name:
# description: 'After the demo env gets created, copy its blob storage name here'
# required: false

permissions:
id-token: write
Expand All @@ -26,7 +28,7 @@ jobs:
- uses: ./.github/actions/build-frontend
name: Build frontend
with:
api-endpoint: https://reportvision-ocr-${{ inputs.deploy-env }}.azurewebsites.net/
api-endpoint: https://reportvision-middleware-demo.azurewebsites.net/
frontend-tarball: ./frontend.tgz
frontend-path: ./frontend
frontend-build-path: ./frontend/dist/
Expand All @@ -35,7 +37,7 @@ jobs:
deploy-with-blob-name-optional:
name: Deploy
runs-on: ubuntu-latest
environment: ${{ inputs.deploy-env }}
environment: demo
needs: [build-frontend]
steps:
- name: Download Artifacts To Job
Expand All @@ -57,10 +59,10 @@ jobs:
- name: Upload to Azure blob storage
shell: bash
run: |
if [ -z "${{ inputs.storage-account-name }}" ]; then
az storage blob upload-batch --account-name reportvisionfrontend${{ inputs.deploy-env }} -d '$web' -s frontend-deploy/ --overwrite
if [ -z "75fcytiuc71jefqdbd3jzpci" ]; then
az storage blob upload-batch --account-name reportvisionfrontenddemo -d '$web' -s frontend-deploy/ --overwrite
else
az storage blob upload-batch --account-name ${{ inputs.storage-account-name }} -d '$web' -s frontend-deploy/ --overwrite
az storage blob upload-batch --account-name 75fcytiuc71jefqdbd3jzpci -d '$web' -s frontend-deploy/ --overwrite
fi
- name: Azure logout
shell: bash
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/build-deploy-ocr.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: Create, publish, deploy a OCR API image

on:
push:
branches: test-deploy-middleware
# workflow_dispatch:
# inputs:
# deploy-env:
# description: 'The environment to deploy to'
# required: true
# type: choice
# options:
# - dev
# - demo
# ocr-docker-tag:
# description: 'This is optional if you would like to deploy an already published OCR-API image'
# required: false
# push:
# branches: test-deploy-middleware
workflow_dispatch:
inputs:
deploy-env:
description: 'The environment to deploy to'
required: true
type: choice
options:
- dev
- demo
ocr-docker-tag:
description: 'This is optional if you would like to deploy an already published OCR-API image'
required: false

permissions:
contents: read
Expand Down

0 comments on commit 9ef479e

Please sign in to comment.