Skip to content

Commit

Permalink
change workflow for dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
chasinandrew committed Oct 3, 2023
1 parent b64f83d commit 8df0e2e
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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 }}"
Expand Down Expand Up @@ -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 }}"
Expand All @@ -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
Expand Down

0 comments on commit 8df0e2e

Please sign in to comment.