Skip to content

Commit

Permalink
feat(actions): use GitHub environments for infra deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavovalverde committed Nov 7, 2024
1 parent 54fe39a commit 255e7f6
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/cd-deploy-nodes-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ jobs:
image_name: zebrad
no_cache: ${{ inputs.no_cache || false }}
rust_log: info
environment: ${{ github.event_name == 'release' && 'prod' || 'dev' }}
# This step needs access to Docker Hub secrets to run successfully
secrets: inherit

Expand Down Expand Up @@ -236,6 +237,7 @@ jobs:
timeout-minutes: 60
env:
CACHED_DISK_NAME: ${{ needs.get-disk-name.outputs.cached_disk_name }}
environment: ${{ github.event_name == 'release' && 'prod' || 'dev' }}
permissions:
contents: 'read'
id-token: 'write'
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/chore-delete-gcp-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
strategy:
matrix:
environment: [dev, prod]
environment: ${{ matrix.environment }}
steps:
- uses: actions/[email protected]
with:
Expand Down Expand Up @@ -105,6 +109,10 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
strategy:
matrix:
environment: [dev, prod]
environment: ${{ matrix.environment }}
steps:
- uses: actions/[email protected]
with:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/manual-zcashd-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ name: Zcashd Manual Deploy
on:
workflow_dispatch:
inputs:
environment:
required: false
default: dev
network:
default: 'Mainnet'
description: 'Network to deploy: Mainnet or Testnet'
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/sub-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ name: Build docker image
on:
workflow_call:
inputs:
environment:
description: 'The infra environment to build the image for'
required: false
default: dev
type: string
image_name:
required: true
type: string
Expand Down Expand Up @@ -77,6 +82,8 @@ jobs:
contents: 'read'
id-token: 'write'
pull-requests: write # for `docker-scout` to be able to write the comment
environment:
name: ${{ inputs.environment }}
env:
DOCKER_BUILD_SUMMARY: ${{ vars.DOCKER_BUILD_SUMMARY }}
steps:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/sub-ci-integration-tests-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ name: Integration Tests on GCP
on:
workflow_call:
inputs:
environment:
required: true
type: string
network:
default: "Mainnet"
type: string
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/sub-deploy-integration-tests-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Deploy Tests to GCP
on:
workflow_call:
inputs:
environment:
required: false
default: dev
type: string
# Status and logging
test_id:
required: true
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/sub-find-cached-disks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ name: Check if cached state disks exist
on:
workflow_call:
inputs:
environment:
required: false
default: dev
type: string
network:
description: 'The Zcash network used to look up the disks'
required: true
Expand Down

0 comments on commit 255e7f6

Please sign in to comment.