Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 177b285

Browse files
authored
chore: Access Secrets based on segregated environments (#51)
1 parent 942a806 commit 177b285

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

.github/workflows/deploy_mainnet.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,25 @@ on:
1111
required: true
1212
type: string
1313

14-
14+
run-name: Deploy Spectre Node to Mainnet - ${{ inputs.release_tag }} by @${{ github.actor }}
15+
1516
env:
16-
AWS_REGION: '${{ secrets.AWS_REGION }}'
1717
ENVIRONMENT: MAINNET
18-
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
1918
REGISTRY: 'ghcr.io'
2019
VERSION: ${{ inputs.release_tag }}
2120

2221
jobs:
2322
deploy:
2423
name: deploy
2524
runs-on: ubuntu-latest
26-
25+
environment: mainnet
2726
permissions:
2827
contents: read
2928
id-token: write
3029
actions: write
31-
30+
env:
31+
AWS_REGION: '${{ secrets.AWS_REGION }}'
32+
AWS_MAINNET: '${{ secrets.AWS_MAINNET }}'
3233
steps:
3334
- name: Authorised User only
3435
run: |
@@ -55,7 +56,7 @@ jobs:
5556
awsRegion=${{ env.AWS_REGION }}
5657
awsEnv=${{ env.ENVIRONMENT }}
5758
imageTag=${{ env.VERSION }}
58-
awsEfs=${{ secrets.SPECTRE_EFS_MAINNET }}
59+
awsEfs=${{ secrets.SPECTRE_EFS }}
5960
6061
- name: Configure AWS Credentials
6162
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/deploy_testnet.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ on:
77
push:
88
branches:
99
- main
10-
10+
11+
run-name: Deploy Spectre Node to Testnet - ${{ inputs.release_tag }} by @${{ github.actor }}
12+
1113
env:
1214
ENVIRONMENT: 'TESTNET'
1315
REGISTRY: 'ghcr.io'
1416
TAG: 'latest'
15-
AWS_TESTNET: '${{ secrets.AWS_ARN }}'
1617

1718
jobs:
1819
push:
@@ -60,13 +61,16 @@ jobs:
6061
needs: push
6162
name: deploy
6263
runs-on: ubuntu-latest
64+
environment: testnet
6365
strategy:
6466
matrix:
6567
spectre_id: [0]
66-
6768
permissions:
6869
contents: read
6970
id-token: write
71+
env:
72+
AWS_TESTNET: '${{ secrets.AWS_TESTNET }}'
73+
AWS_REGION: '${{ secrets.AWS_REGION }}'
7074

7175
steps:
7276
- name: checkout ecs repo
@@ -84,15 +88,15 @@ jobs:
8488
variables: |
8589
spectreId=${{ matrix.spectre_id }}
8690
awsAccountId=${{ env.AWS_TESTNET }}
87-
awsRegion=${{ secrets.AWS_REGION }}
88-
awsEfs=${{ secrets.SPECTRE_EFS_TESTNET }}
91+
awsRegion=${{ env.AWS_REGION }}
92+
awsEfs=${{ secrets.SPECTRE_EFS }}
8993
imageTag=${{ github.ref_name }}
9094
9195
- name: configure aws credentials
9296
uses: aws-actions/configure-aws-credentials@v4
9397
with:
9498
role-to-assume: arn:aws:iam::${{ env.AWS_TESTNET }}:role/github-actions-${{ env.ENVIRONMENT }}-chainbridge
95-
aws-region: ${{ secrets.AWS_REGION }}
99+
aws-region: ${{ env.AWS_REGION }}
96100
role-session-name: GithubActions
97101

98102
- name: deploy task definition

0 commit comments

Comments
 (0)