diff --git a/.github/workflows/app_build_deploy.yaml b/.github/workflows/app_build_deploy.yaml index 765dd35..7fe7324 100644 --- a/.github/workflows/app_build_deploy.yaml +++ b/.github/workflows/app_build_deploy.yaml @@ -5,10 +5,7 @@ on: environment_name: required: true type: string - version_number: - required: true - type: string - + env: VITE_API_URL: ${{ vars.VITE_API_URL }} VITE_CLIENT_ID: ${{ vars.VITE_CLIENT_ID }} diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml deleted file mode 100644 index 6aaa6e2..0000000 --- a/.github/workflows/deploy.yaml +++ /dev/null @@ -1,35 +0,0 @@ -name: Deploy -on: - workflow_call: - inputs: - app_name: - required: true - type: string - environment_name: - required: true - type: string - version_number: - required: true - type: string - -permissions: - id-token: write - contents: read -jobs: - deploy: - runs-on: ubuntu-latest - environment: ${{ inputs.environment_name }} - steps: - - name: Log in to Azure - uses: azure/login@v2 - with: - client-id: ${{ vars.VITE_CLIENT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - tenant-id: ${{ vars.VITE_TENANT_ID }} - - - name: Azure CLI script - uses: azure/cli@v2 - with: - azcliversion: latest - inlineScript: | - az containerapp update --name ${{ inputs.app_name }}-${{ inputs.environment_name }} --resource-group noahspan-root --image docker.io/noahspan/${{ inputs.app_name }}:${{ inputs.version_number }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b9a54da..bf29127 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -24,7 +24,7 @@ jobs: needs: - changes - build-api - uses: ./.github/workflows/deploy.yaml + uses: ./.github/workflows/api_deploy.yaml with: app_name: root-api environment_name: test @@ -33,23 +33,11 @@ jobs: build-deploy-app: if: ${{ needs.changes.outputs.app == 'true' }} - name: build-app + name: build-deploy-app needs: - changes uses: ./.github/workflows/app_build_deploy.yaml with: environment_name: test - version_number: ${{ github.run_id }} secrets: inherit - # deploy-app: - # name: deploy-app - # needs: - # - changes - # - build-app - # uses: ./.github/workflows/deploy.yaml - # with: - # app_name: root-app - # environment_name: test - # version_number: ${{ github.run_id }} - # secrets: inherit diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index d712b8c..20c00d0 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -26,5 +26,4 @@ jobs: uses: ./.github/workflows/app_build_deploy.yaml with: environment_name: pull_request - version_number: ${{ github.run_id }} secrets: inherit diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index 0d0c29a..ae40751 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -17,28 +17,16 @@ jobs: name: deploy-api needs: - build-api - uses: ./.github/workflows/deploy.yaml + uses: ./.github/workflows/api_deploy.yaml with: app_name: root-api environment_name: prod version_number: ${{ github.ref_name }} secrets: inherit - build-app: - name: build-app - uses: ./.github/workflows/app_build.yaml + build-deploy-app: + name: build-deploy-app + uses: ./.github/workflows/app_build_deploy.yaml with: environment_name: prod - version_number: ${{ github.ref_name }} - secrets: inherit - - deploy-app: - name: deploy-app - needs: - - build-app - uses: ./.github/workflows/deploy.yaml - with: - app_name: root-app - environment_name: prod - version_number: ${{ github.ref_name }} secrets: inherit diff --git a/infrastructure/config/main.tf b/infrastructure/config/main.tf index de054fb..5bdb157 100644 --- a/infrastructure/config/main.tf +++ b/infrastructure/config/main.tf @@ -56,6 +56,12 @@ locals { index_document = "index.html" } ] + prod = [ + { + error_404_document = "custom_not_found.html" + index_document = "index.html" + } + ] } storage_account_name = { @@ -73,6 +79,15 @@ locals { source = "index.html" } ] + prod = [ + { + name = "web" + storage_container_name = "$web" + type = "Block" + content_type = "text/html" + source = "index.html" + } + ] } storage_tables = {