Skip to content

Commit f72aa1b

Browse files
committed
ci: Move check earlier
1 parent 3487fb0 commit f72aa1b

File tree

1 file changed

+22
-23
lines changed

1 file changed

+22
-23
lines changed

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

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,27 +38,7 @@ jobs:
3838
env:
3939
CI: true
4040
steps:
41-
- uses: actions/checkout@v4
42-
with:
43-
fetch-depth: 0
44-
45-
- uses: actions/setup-node@v4
46-
with:
47-
node-version: 20
48-
cache: 'npm'
49-
cache-dependency-path: 'packages/sharing-smart-contract'
50-
51-
- name: Install dependencies
52-
working-directory: packages/sharing-smart-contract
53-
run: npm ci
54-
55-
- name: Install Foundry
56-
uses: foundry-rs/foundry-toolchain@v1
57-
with:
58-
version: stable
59-
cache: true
60-
61-
- name: Validate deployment environment and prepare variables
41+
- name: Validate deployment environment
6242
if: inputs.network != 'hardhat'
6343
env:
6444
NETWORK: ${{ inputs.network }}
@@ -68,7 +48,7 @@ jobs:
6848
case "$NETWORK" in
6949
arbitrum|bellecour)
7050
if [ "$STAGE" = "dev" ]; then
71-
echo "Error: Cannot deploy to mainnet ($NETWORK) with dev stage"
51+
echo "Error: Cannot use 'dev' stage with mainnet ($NETWORK)"
7252
exit 1
7353
fi
7454
# Use <network> as deployment id for mainnets.
@@ -81,8 +61,27 @@ jobs:
8161
esac
8262
echo "deployment-id=$DEPLOYMENT_ID" >> $GITHUB_OUTPUT
8363
64+
- uses: actions/checkout@v4
65+
with:
66+
fetch-depth: 0
67+
68+
- uses: actions/setup-node@v4
69+
with:
70+
node-version: 20
71+
cache: 'npm'
72+
cache-dependency-path: 'packages/sharing-smart-contract'
73+
74+
- name: Install dependencies
75+
working-directory: packages/sharing-smart-contract
76+
run: npm ci
77+
78+
- name: Install Foundry
79+
uses: foundry-rs/foundry-toolchain@v1
80+
with:
81+
version: stable
82+
cache: true
83+
8484
- name: Deploy contracts
85-
id: deploy
8685
working-directory: packages/sharing-smart-contract
8786
env:
8887
# For Deployment

0 commit comments

Comments
 (0)