Skip to content

Commit 5bd84ac

Browse files
committed
ci: Rename CI parameter for better clarity
1 parent 08dd1ac commit 5bd84ac

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

.github/workflows/sharing-smart-contract-deploy.yml

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ on:
1414
- arbitrum
1515
- bellecour
1616
default: 'hardhat'
17-
environment:
18-
description: 'Environment'
17+
stage:
18+
description: 'Deployment stage'
1919
required: true
2020
type: choice
2121
options:
@@ -32,11 +32,11 @@ jobs:
3232
deploy:
3333
needs: build-and-test
3434
runs-on: ubuntu-latest
35-
env:
36-
CI: true
35+
environment: ${{ inputs.network }}
3736
permissions:
3837
contents: write # Required to commit deployment files.
39-
environment: ${{ inputs.network }}
38+
env:
39+
CI: true
4040
steps:
4141
- uses: actions/checkout@v4
4242
with:
@@ -60,17 +60,17 @@ jobs:
6060

6161
- name: Validate deployment environment and prepare variables
6262
if: inputs.network != 'hardhat'
63+
env:
64+
NETWORK: ${{ inputs.network }}
65+
STAGE: ${{ inputs.stage }}
6366
run: |
64-
NETWORK="${{ inputs.network }}"
65-
ENVIRONMENT="${{ inputs.environment }}"
66-
6767
case "$NETWORK" in
6868
arbitrum|bellecour)
69-
if [ "$ENVIRONMENT" = "dev" ]; then
70-
echo "Error: Cannot deploy to mainnet ($NETWORK) with dev environment"
69+
echo "IS_MAINNET=true" >> $GITHUB_ENV
70+
if [ "$STAGE" = "dev" ]; then
71+
echo "Error: Cannot deploy to mainnet ($NETWORK) with dev stage"
7172
exit 1
7273
fi
73-
echo "IS_MAINNET=true" >> $GITHUB_ENV
7474
;;
7575
*)
7676
echo "IS_MAINNET=false" >> $GITHUB_ENV
@@ -91,9 +91,9 @@ jobs:
9191
if [ "${{ inputs.network }}" = "hardhat" ]; then
9292
npm run deploy -- --network ${{ inputs.network }}
9393
else
94-
# For testnets, use network-environment; for mainnets, use network only
94+
# For testnets, use network-stage; for mainnets, use network only
9595
if [ "$IS_MAINNET" = false ]; then
96-
DEPLOYMENT_ID="${{ inputs.network }}-${{ inputs.environment }}"
96+
DEPLOYMENT_ID="${{ inputs.network }}-${{ inputs.stage }}"
9797
else
9898
DEPLOYMENT_ID="${{ inputs.network }}"
9999
fi
@@ -106,7 +106,7 @@ jobs:
106106
if: inputs.network != 'hardhat'
107107
uses: stefanzweifel/git-auto-commit-action@v5
108108
with:
109-
commit_message: 'chore: save deployment artifacts for ${{ inputs.network }} ${{ inputs.environment }} (${{ github.run_id }})'
109+
commit_message: 'chore: save deployment artifacts for ${{ inputs.network }} ${{ inputs.stage }} (${{ github.run_id }})'
110110
file_pattern: 'packages/sharing-smart-contract/ignition/deployments/* packages/sharing-smart-contract/.openzeppelin/*'
111111
commit_user_name: 'GitHub Actions Bot'
112112
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
@@ -121,11 +121,10 @@ jobs:
121121
EXPLORER_API_KEY: ${{ secrets.EXPLORER_API_KEY }}
122122
IS_VERIFICATION_API_V2: ${{ vars.IS_VERIFICATION_API_V2 }}
123123
run: |
124-
# For testnets, use network-environment; for mainnets, use network only
124+
# For testnets, use network-stage; for mainnets, use network only
125125
if [ "$IS_MAINNET" = false ]; then
126-
DEPLOYMENT_ID="${{ inputs.network }}-${{ inputs.environment }}"
126+
DEPLOYMENT_ID="${{ inputs.network }}-${{ inputs.stage }}"
127127
else
128128
DEPLOYMENT_ID="${{ inputs.network }}"
129129
fi
130130
npm run verify -- "$DEPLOYMENT_ID"
131-

0 commit comments

Comments
 (0)