Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/fund-sepolia-accounts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,10 @@ jobs:
run: |
echo "Saving mnemonic to GCP"
echo "::add-mask::${{ steps.fund-accounts.outputs.mnemonic }}"
gcloud secrets versions add latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }} --data-file="$MNEMONIC_FILE"
echo "Creating new secret ${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
gcloud secrets create ${{ inputs.sepolia_accounts_mnemonic_secret_name }}
TMP_FILE=$(mktemp)
echo "${{ steps.fund-accounts.outputs.mnemonic }}" > "$TMP_FILE"
gcloud secrets versions add ${{ inputs.sepolia_accounts_mnemonic_secret_name }} --data-file="$TMP_FILE"
rm "$TMP_FILE"
echo "Saved mnemonic to GCP secret ${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
17 changes: 13 additions & 4 deletions .github/workflows/network-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,18 +91,17 @@ on:
type: string
default: "false"
sepolia_accounts_mnemonic_secret_name:
description: The name of the secret which holds the sepolia accounts mnemonic (required for sepolia deployment)
description: The name of the secret which holds the sepolia accounts mnemonic (if not provided, will use '{namespace}-accounts-mnemonic').
required: false
type: string
default: sepolia-accounts-mnemonic

jobs:
fund_sepolia_accounts:
if: ${{ inputs.sepolia_deployment == 'true' }}
uses: ./.github/workflows/fund-sepolia-accounts.yml
with:
values_file: ${{ inputs.values_file }}
sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name }}
sepolia_accounts_mnemonic_secret_name: ${{ inputs.sepolia_accounts_mnemonic_secret_name || format('{0}-accounts-mnemonic', inputs.namespace) }}
ref: ${{ inputs.ref || github.ref || 'master' }}
secrets:
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
Expand Down Expand Up @@ -212,6 +211,11 @@ jobs:
continue-on-error: true
run: |
if ${{ inputs.sepolia_deployment == 'true' }}; then
if [ -z "${{ inputs.sepolia_accounts_mnemonic_secret_name }}" ]; then
SECRET_NAME="${{ env.NAMESPACE }}-accounts-mnemonic"
else
SECRET_NAME="${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
fi
L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }})
terraform destroy -auto-approve \
-var="RELEASE_NAME=${{ env.NAMESPACE }}" \
Expand Down Expand Up @@ -243,7 +247,12 @@ jobs:
working-directory: ./spartan/terraform/deploy-release
run: |
if ${{ inputs.sepolia_deployment == 'true' }}; then
L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=${{ inputs.sepolia_accounts_mnemonic_secret_name }})
if [ -z "${{ inputs.sepolia_accounts_mnemonic_secret_name }}" ]; then
SECRET_NAME="${{ env.NAMESPACE }}-accounts-mnemonic"
else
SECRET_NAME="${{ inputs.sepolia_accounts_mnemonic_secret_name }}"
fi
L1_DEPLOYMENT_MNEMONIC=$(gcloud secrets versions access latest --secret=$SECRET_NAME)
terraform plan \
-var="RELEASE_NAME=${{ env.NAMESPACE }}" \
-var="VALUES_FILE=${{ env.VALUES_FILE }}" \
Expand Down