Merge pull request #5604 from HHS/improve-ssl-vuln-and-deps #1554
This file contains hidden or 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: Dev Frontend Build and Deploy | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - 'main' | |
| paths: | |
| - 'frontend/**' | |
| env: | |
| WORKING_DIR: "frontend" | |
| DOCKER_FILE: "Dockerfile.azure" | |
| ENVIRONMENT: dev | |
| DOMAIN_NAME: "ops.opre.acf.gov" | |
| jobs: | |
| build-frontend: | |
| permissions: | |
| contents: read | |
| packages: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.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 }}, VITE_ENABLE_MSW=false, BUILD_STORYBOOK=true" | |
| deploy-frontend: | |
| needs: build-frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Update yaml file to provide revision suffix | |
| uses: fjogeleit/yaml-update-action@dffe9a5223d84653c13374032382f6bb5de8e5ef # v0.17.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@532459ea530d8321f2fb9bb10d1e0bcf23869a43 # v3.0.0 | |
| with: | |
| creds: ${{ secrets.SDLC_AZURE_CREDS }} | |
| - name: Deploy Container App | |
| uses: azure/container-apps-deploy-action@8dff69dac3367c32ceb2690d8f13adbeab462703 # 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 |