E2E Wallet Fund and Faucet Balance #347
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: E2E Wallet Fund and Faucet Balance | |
on: | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: 'Log level' | |
required: true | |
default: 'warning' | |
tags: | |
description: 'E2E Wallet Fund and Faucet Balance' | |
# Cron job to run faucet fund and balance every 8th hour | |
schedule: | |
- cron: '0 */8 * * *' | |
jobs: | |
balance-and-fund: | |
name: balance-and-fund | |
runs-on: ubuntu-latest | |
env: | |
# `if` conditions can't directly access secrets, so we use a workaround | |
# See https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow | |
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }} | |
BASH_ENV: ~/.profile | |
steps: | |
- uses: google-github-actions/auth@v2 | |
if: ${{ env.SECRETS_AVAILABLE }} | |
with: | |
project_id: celo-mobile-mainnet | |
credentials_json: ${{ secrets.MAINNET_SERVICE_ACCOUNT_KEY }} | |
- name: Google Secrets | |
if: ${{ env.SECRETS_AVAILABLE }} | |
id: google-secrets | |
uses: google-github-actions/get-secretmanager-secrets@v2.2.2 | |
with: | |
secrets: |- | |
E2E_TEST_FAUCET_SECRET:projects/1027349420744/secrets/E2E_TEST_FAUCET_SECRET | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/yarn-install | |
- name: Run Balance and Fund | |
run: NODE_OPTIONS='--unhandled-rejections=strict' yarn ts-node ./e2e/scripts/fund-e2e-accounts.ts | |
env: | |
E2E_TEST_FAUCET_SECRET: ${{ steps.google-secrets.outputs.E2E_TEST_FAUCET_SECRET }} |