Skip to content

Commit

Permalink
segregate secrets based on environments
Browse files Browse the repository at this point in the history
  • Loading branch information
eedygreen committed Oct 29, 2024
1 parent eb9f98d commit ff20359
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/deploy_mainnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,25 @@ on:
description: deploy v2
type: string

run-name: Deploy Explorer-Indexer to Mainnet - ${{ inputs.release_tag }} by @${{ github.actor }}

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
ENVIRONMENT: MAINNET
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
REGISTRY: 'ghcr.io'
VERSION: ${{ inputs.release_tag }}

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest

environment: testnet
permissions:
contents: read
id-token: write
actions: write

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
steps:
- name: checkout ecs repo
uses: actions/checkout@v4
Expand All @@ -46,8 +48,8 @@ jobs:
awsAccountId=${{ env.AWS_MAINNET }}
awsRegion=${{ env.AWS_REGION }}
awsEnv=${{ env.ENVIRONMENT }}
DB_USERNAME=${{ secrets.MAIN_USERNAME }}
DB_PASSWORD=${{ secrets.MAIN_PASSWORD }}
DB_USERNAME=${{ secrets.DB_USERNAME }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
imageTag=${{ env.VERSION }}
- name: Configure AWS Credentials
Expand Down Expand Up @@ -78,12 +80,14 @@ jobs:
# name: deploy v2

# runs-on: ubuntu-latest

# environment: mainnet
# permissions:
# contents: read
# id-token: write
# actions: write

# env:
# AWS_REGION: '${{ secrets.AWS_REGION }}'
# AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
# steps:
# - name: checkout ecs repo
# uses: actions/checkout@v4
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/deploy_mainnet_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,25 @@ on:
default: 'stable'
type: string

run-name: Deploy Explorer-API to Mainnet - ${{ inputs.release_tag }} by @${{ github.actor }}

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
ENVIRONMENT: MAINNET
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
REGISTRY: 'ghcr.io'
VERSION: ${{ inputs.release_tag }}

jobs:
deploy:
name: deploy
runs-on: ubuntu-latest

environment: mainnet
permissions:
contents: read
id-token: write
actions: write

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
steps:
- name: checkout ecs repo
uses: actions/checkout@v4
Expand All @@ -44,8 +46,8 @@ jobs:
awsAccountId=${{ env.AWS_MAINNET }}
awsRegion=${{ env.AWS_REGION }}
awsEnv=${{ env.ENVIRONMENT }}
DB_USERNAME=${{ secrets.MAIN_USERNAME }}
DB_PASSWORD=${{ secrets.MAIN_PASSWORD }}
DB_USERNAME=${{ secrets.DB_USERNAME }}
DB_PASSWORD=${{ secrets.DB_PASSWORD }}
imageTag=${{ env.VERSION }}
- name: Configure AWS Credentials
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/deploy_testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
types:
- published

run-name: Deploy Explorer-Indexer to Testnet - ${{ inputs.release_tag }} by @${{ github.actor }}

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
ENVIRONMENT: TESTNET
AWS_TESTNET: '${{ secrets.AWS_ARN }}'
REGISTRY: 'ghcr.io'
TAG: 'stable'
VERSION: ${{ github.event.release.tag_name }}
Expand Down Expand Up @@ -59,12 +59,14 @@ jobs:
needs: push
name: deploy
runs-on: ubuntu-latest

environment: testnet
permissions:
contents: read
id-token: write
actions: write

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_TESTNET: '${{ secrets.AWS_ARN }}'
steps:
- name: checkout ecs repo
uses: actions/checkout@v4
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/deploy_testnet_api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
types:
- published

run-name: Deploy Explorer-API to Testnet - ${{ inputs.release_tag }} by @${{ github.actor }}

env:
AWS_REGION: '${{ secrets.AWS_REGION }}'
ENVIRONMENT: TESTNET
AWS_TESTNET: '${{ secrets.AWS_ARN }}'
REGISTRY: 'ghcr.io'
TAG: 'stable'
VERSION: ${{ github.event.release.tag_name }}
Expand Down Expand Up @@ -61,12 +61,14 @@ jobs:
needs: push
name: deploy
runs-on: ubuntu-latest

environment: testnet
permissions:
contents: read
id-token: write
actions: write

env:
AWS_TESTNET: '${{ secrets.AWS_ARN }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
steps:
- name: checkout ecs repo
uses: actions/checkout@v4
Expand Down

0 comments on commit ff20359

Please sign in to comment.