Skip to content

Commit

Permalink
Reorganizing actions to use environments
Browse files Browse the repository at this point in the history
  • Loading branch information
bergsalex committed Dec 11, 2023
1 parent 2876216 commit 80ed376
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
25 changes: 7 additions & 18 deletions .github/workflows/_skaffold-deploy-k8s.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ name: 'Python Tests Definition'
on:
workflow_call:
inputs:
cluster_project:
description: 'Cluster project'
required: true
type: string
cluster_region:
description: 'Cluster region'
required: true
type: string
cluster_name:
description: 'Cluster name'
required: true
type: string
deployment_profile:
description: 'Deployment profile'
environment:
description: 'Deployment Environment'
required: true
type: string
default_image_repo:
Expand All @@ -26,6 +14,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
Expand Down Expand Up @@ -53,13 +42,13 @@ jobs:
credentials_json: '${{ secrets.GCLOUD_CLUSTER_SA_KEY }}'
- name: Get Cluster Credentials
run: |
gcloud container clusters get-credentials ${{ inputs.cluster_name }} \
--region ${{ inputs.cluster_region }} \
--project ${{ inputs.cluster_project }}
gcloud container clusters get-credentials ${{ vars.CLUSTER_NAME }} \
--region ${{ vars.CLUSTER_REGION }} \
--project ${{ vars.CLUSTER_PROJECT }}
- name: Deploy
run: |
skaffold deploy \
--profile ${{ inputs.deployment_profile }} \
--profile ${{ inputs.environment }} \
--build-artifacts=build.json
- name: Upload build artifact JSON
uses: actions/upload-artifact@v3
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pull_requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
- 'main'
jobs:
test:
name: Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
Expand All @@ -15,11 +16,11 @@ jobs:
python-version: ${{ matrix.python-version }}
required-coverage: ${{ vars.REQUIRED_COVERAGE }}
build_and_deploy:
name: Build and Deploy
needs: test
uses: ./.github/workflows/_skaffold-deploy-k8s.yml
with:
environment: jax-cluster-dev-10--dev
cluster_project: ${{ vars.DEV_CLUSTER_PROJECT }}
cluster_region: ${{ vars.CLUSTER_REGION }}
cluster_name: ${{ vars.DEV_CLUSTER_NAME }}
deployment_profile: "${{ vars.DEV_CLUSTER_PROJECT }}--dev"
default_image_repo: "us-east1-docker.pkg.dev/jax-cs-registry/docker-test/geneweaver"

0 comments on commit 80ed376

Please sign in to comment.