Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change workflow for dispatch #94

Merged
merged 1 commit into from
Oct 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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