feat(actions): use GitHub `environments` for infra deployments

This commit is contained in:
Gustavo Valverde 2024-11-07 12:59:33 +00:00
parent 0fe47bbbbb
commit a68430f6c0
7 changed files with 31 additions and 0 deletions

View File

@ -174,6 +174,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
@ -239,6 +240,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'

View File

@ -38,6 +38,10 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
strategy:
matrix:
environment: [dev, prod]
environment: ${{ matrix.environment }}
steps:
- uses: actions/checkout@v4.2.2
with:
@ -105,6 +109,10 @@ jobs:
permissions:
contents: 'read'
id-token: 'write'
strategy:
matrix:
environment: [dev, prod]
environment: ${{ matrix.environment }}
steps:
- uses: actions/checkout@v4.2.2
with:

View File

@ -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'

View File

@ -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
@ -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:

View File

@ -8,6 +8,9 @@ name: Integration Tests on GCP
on:
workflow_call:
inputs:
environment:
required: true
type: string
network:
default: "Mainnet"
type: string

View File

@ -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

View File

@ -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