Skip to content

Commit

Permalink
Fix GHA env vars passing
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas committed Sep 26, 2023
1 parent 6ae05a7 commit b0ddd95
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 16 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/api-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: API image
on:
workflow_call:
secrets:
service_account_email:
required: true
workload_identity_provider:
required: true
gce_project:
required: true

Expand All @@ -20,8 +24,8 @@ jobs:
- name: Setup Service Account
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
workload_identity_provider: ${{ secrets.workload_identity_provider }}
service_account: ${{ secrets.service_account_email }}

- name: Configure Docker
run: gcloud --quiet auth configure-docker us-central1-docker.pkg.dev
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/cluster-disk-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Cluster disk image

on:
workflow_call:
secrets:
service_account_email:
required: true
workload_identity_provider:
required: true

jobs:
publish:
Expand All @@ -15,8 +20,8 @@ jobs:
# uses: google-github-actions/auth@v1
# with:
# create_credentials_file: true
# workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
# service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
# workload_identity_provider: ${{ secrets.workload_identity_provider }}
# service_account: ${{ secrets.service_account_email }}

# - name: Setup Packer
# uses: hashicorp-contrib/setup-packer@v2
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/env-build-task-driver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Env build task driver

on:
workflow_call:
secrets:
service_account_email:
required: true
workload_identity_provider:
required: true

jobs:
publish:
Expand Down Expand Up @@ -29,8 +34,8 @@ jobs:
- name: Setup Service Account
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
workload_identity_provider: ${{ secrets.workload_identity_provider }}
service_account: ${{ secrets.service_account_email }}

- name: List files
run: ls -la ./packages/env-build-task-driver/bin
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/env-instance-task-driver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Env instance task driver

on:
workflow_call:
secrets:
service_account_email:
required: true
workload_identity_provider:
required: true

jobs:
publish:
Expand Down Expand Up @@ -29,8 +34,8 @@ jobs:
- name: Setup Service Account
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
workload_identity_provider: ${{ secrets.workload_identity_provider }}
service_account: ${{ secrets.service_account_email }}

- name: Upload firecracker task driver
uses: "google-github-actions/upload-cloud-storage@v1"
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/envd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Envd
on:
workflow_call:
secrets:
service_account_email:
required: true
workload_identity_provider:
required: true
version:
required: true

Expand Down Expand Up @@ -34,8 +38,8 @@ jobs:
- name: Setup Service Account
uses: google-github-actions/auth@v1
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
workload_identity_provider: ${{ secrets.workload_identity_provider }}
service_account: ${{ secrets.service_account_email }}

- name: Upload envd
uses: "google-github-actions/upload-cloud-storage@v1"
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ jobs:
needs.changes.outputs.version == 'true' &&
needs.changes.outputs.env-instance-task-driver == 'true'
uses: ./.github/workflows/env-instance-task-driver.yml
secrets:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}

env-build-task-driver:
name: Env build task driver
Expand All @@ -85,6 +88,9 @@ jobs:
needs.changes.outputs.version == 'true' &&
needs.changes.outputs.env-build-task-driver == 'true'
uses: ./.github/workflows/env-build-task-driver.yml
secrets:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}

cluster-disk-image:
name: Cluster disk image
Expand All @@ -94,6 +100,9 @@ jobs:
needs.changes.outputs.version == 'true' &&
needs.changes.outputs.cluster-disk-image == 'true'
uses: ./.github/workflows/cluster-disk-image.yml
secrets:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}

envd:
name: Env Daemon
Expand All @@ -104,6 +113,8 @@ jobs:
needs.changes.outputs.envd == 'true'
uses: ./.github/workflows/envd.yml
secrets:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
version: ${{ needs.changes.outputs.get-version }}

api-image:
Expand All @@ -115,6 +126,8 @@ jobs:
needs.changes.outputs.api-image == 'true'
uses: ./.github/workflows/api-image.yml
secrets:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
gce_project: ${{ secrets.GCE_PROJECT }}

terraform:
Expand All @@ -138,6 +151,13 @@ jobs:
(needs.env-build-task-driver.result == 'success' || needs.env-build-task-driver.result == 'skipped') &&
(needs.api-image.result == 'success' || needs.api-image.result == 'skipped')
uses: ./.github/workflows/terraform.yml
secrets:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account_email: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
client_machine_type: ${{ secrets.CLIENT_MACHINE_TYPE }}
client_cluster_size: ${{ secrets.CLIENT_CLUSTER_SIZE }}
server_machine_type: ${{ secrets.SERVER_MACHINE_TYPE }}
server_cluster_size: ${{ secrets.SERVER_CLUSTER_SIZE }}

# The last successful release is used for determining which changed and what should be deployed in this release.
release:
Expand Down
25 changes: 19 additions & 6 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@ name: Terraform

on:
workflow_call:
secrets:
service_account_email:
required: true
workload_identity_provider:
required: true
server_cluster_size:
required: true
server_machine_type:
required: true
client_cluster_size:
required: true
client_machine_type:
required: true

jobs:
deploy:
Expand All @@ -15,8 +28,8 @@ jobs:
uses: google-github-actions/auth@v1
with:
create_credentials_file: true
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
service_account: ${{ secrets.SERVICE_ACCOUNT_EMAIL }}
workload_identity_provider: ${{ secrets.workload_identity_provider }}
service_account: ${{ secrets.service_account_email }}

- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
Expand Down Expand Up @@ -44,7 +57,7 @@ jobs:
run: make apply
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tf_var_client_machine_type: ${{ secrets.CLIENT_MACHINE_TYPE }}
tf_var_client_cluster_size: ${{ secrets.CLIENT_CLUSTER_SIZE }}
tf_var_server_machine_type: ${{ secrets.SERVER_MACHINE_TYPE }}
tf_var_server_cluster_size: ${{ secrets.SERVER_CLUSTER_SIZE }}
tf_var_client_machine_type: ${{ secrets.client_machine_type }}
tf_var_client_cluster_size: ${{ secrets.client_cluster_size }}
tf_var_server_machine_type: ${{ secrets.server_machine_type }}
tf_var_server_cluster_size: ${{ secrets.server_cluster_size }}

0 comments on commit b0ddd95

Please sign in to comment.