diff --git a/.github/workflows/_deployment.yaml b/.github/workflows/_deployment.yaml index 28776aa..158db58 100644 --- a/.github/workflows/_deployment.yaml +++ b/.github/workflows/_deployment.yaml @@ -44,22 +44,22 @@ jobs: uses: actions/checkout@v3 # Initializes the CodeQL tools for scanning. - # - name: Initialize CodeQL - # uses: github/codeql-action/init@v2 - # with: - # languages: ${{ matrix.language }} - # source-root: ${{ vars.code_directory }} + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + source-root: ${{ vars.code_directory }} - # # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). - # # If this step fails, then you should remove it and run the build manually (see below) - # - name: Autobuild - # uses: github/codeql-action/autobuild@v2 - # #TODO: add if statement for dotnet and python + # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + #TODO: add if statement for dotnet and python - # - name: Perform CodeQL Analysis - # uses: github/codeql-action/analyze@v2 - # with: - # category: "/language:${{matrix.language}}" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:${{matrix.language}}" image-build-push: if: contains(fromJSON('["develop", "main"]'), github.ref_name) @@ -83,6 +83,7 @@ jobs: # Authenticate Docker to Google Cloud Artifact Registry - name: Docker Authentication + if: github.event_name != 'workflow_dispatch' id: docker-auth uses: 'docker/login-action@v1' with: @@ -91,6 +92,7 @@ jobs: registry: '${{ vars.region }}-docker.pkg.dev' - name: Build and Tag + if: github.event_name != 'workflow_dispatch' id: build-image uses: docker/build-push-action@v3 with: @@ -101,6 +103,7 @@ jobs: ${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:latest - name: Docker Push + if: github.event_name != 'workflow_dispatch' shell: bash run: |- docker push "${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:${{ github.sha }}" @@ -148,7 +151,7 @@ jobs: - name: Create Service ${{ inputs.environment }} Declaration if: inputs.environment == 'prod' run: |- - export CONTAINER_IMAGE="${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:${{ vars.ref }}" + export CONTAINER_IMAGE="${{ vars.region }}-docker.pkg.dev/${{ vars.artifact_registry_project }}/${{ vars.artifact_registry_repo }}/${{ vars.service_name }}:${{ github.sha }}" export SERVICE_NAME="${{ vars.service_name }}" export PROJECT_ID="${{ vars.gcp_project_id }}" export REVISION_TAG="${{ vars.ref }}" @@ -161,7 +164,7 @@ jobs: export HCA_PROJECT_ID="${{ vars.hca_project_id }}" export TCO_ID="${{ vars.tco_id }}" export ENVIRONMENT="${{ inputs.environment }}" - export NEW_REVISION_PERCENTAGE=${{ inputs.new_revision_percentage }} + export NEW_REVISION_PERCENTAGE=${{ vars.service_name }}-${{ github.sha }} export EXISTING_REVISION=${{ inputs.existing_revision }} export EXISTING_REVISION_PERCENTAGE=${{ inputs.existing_revision_percentage }} envsubst < ./service-yaml/container-canary.yaml > container-canary.yaml