diff --git a/.github/workflows/_skaffold-deploy-k8s.yml b/.github/workflows/_skaffold-deploy-k8s.yml index bd48af2..7697f61 100644 --- a/.github/workflows/_skaffold-deploy-k8s.yml +++ b/.github/workflows/_skaffold-deploy-k8s.yml @@ -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: @@ -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 @@ -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 diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 7845967..159c745 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -5,6 +5,7 @@ on: - 'main' jobs: test: + name: Test strategy: matrix: os: [ubuntu-latest, macos-latest] @@ -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" \ No newline at end of file