feat: update frontend can history query, add fiscal year to the CAN h… #226
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Staging Frontend Build and Deploy | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'frontend/**' | |
env: | |
WORKING_DIR: "frontend" | |
DOCKER_FILE: "Dockerfile.azure" | |
ENVIRONMENT: stg | |
DOMAIN_NAME: "ops.opre.acf.gov" | |
jobs: | |
build-frontend: | |
permissions: | |
contents: read | |
packages: write | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Build and publish the Docker image for ${{ github.repository }} | |
uses: ./.github/actions/build-and-push | |
with: | |
image_name: ${{ github.repository }}/ops-${{ env.WORKING_DIR }} # it will be lowercased internally | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
context: ${{ github.workspace }}/${{ env.WORKING_DIR }} | |
dockerfile: ${{ github.workspace }}/${{ env.WORKING_DIR }}/${{ env.DOCKER_FILE }} | |
image_tags: "${{ github.sha }},${{ env.ENVIRONMENT }}" | |
build_args: "VITE_BACKEND_DOMAIN=https://${{ env.ENVIRONMENT }}.${{ env.DOMAIN_NAME }}, MODE=${{ env.ENVIRONMENT }}" | |
deploy-frontend: | |
needs: build-frontend | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Update yaml file to provide revision suffix | |
uses: fjogeleit/yaml-update-action@b75e8a929eb61bff6b67a6114943c9468f0bd933 # v0.16.0 | |
with: | |
valueFile: './.github/container-app-suffixes.yml' | |
propertyPath: 'template.revisionSuffix' | |
value: ${{ github.run_id }}-${{ github.run_number }} | |
commitChange: false | |
- name: Log in to Azure | |
uses: azure/login@a65d910e8af852a8061c627c456678983e180302 # v2.2.0 | |
with: | |
creds: ${{ secrets.SDLC_AZURE_CREDS }} | |
- name: Deploy Container App | |
uses: azure/container-apps-deploy-action@5f5f4c56ca90376e3cfbd76ba8fe8533c784e655 # v2 | |
with: | |
containerAppName: opre-ops-${{ env.ENVIRONMENT }}-app-${{ env.WORKING_DIR }} | |
resourceGroup: opre-ops-${{ env.ENVIRONMENT }}-app-rg | |
imageToDeploy: ghcr.io/hhs/opre-ops/ops-${{ env.WORKING_DIR }}:${{ env.ENVIRONMENT }} | |
yamlConfigPath: ./.github/container-app-suffixes.yml |