11name : Sharing Smart Contract - Deploy
22
33on :
4+ push :
5+ branches :
6+ - ci/sharing--refactor-deploy-action
47 workflow_dispatch : # Manual trigger
58 inputs :
69 network :
2427 default : ' dev'
2528
2629jobs :
27- build-and-test :
28- uses : ./.github/workflows/sharing-smart-contracts-ci.yml
29- with :
30- node-version : 20
30+ # build-and-test:
31+ # uses: ./.github/workflows/sharing-smart-contracts-ci.yml
32+ # with:
33+ # node-version: 20
3134
3235 deploy :
33- needs : build-and-test
36+ # needs: build-and-test
3437 runs-on : ubuntu-latest
3538 environment : ${{ inputs.network }}
3639 permissions :
@@ -41,11 +44,10 @@ jobs:
4144 COMMIT_MESSAGE : ' chore: Save deployment artifacts for ${{ inputs.network }} ${{ inputs.stage }} (${{ github.run_id }})'
4245 GHA_BOT_NAME : ' GitHub Actions Bot'
4346 GHA_BOT_EMAIL : ' github-actions[bot]@users.noreply.github.com'
44- # commit_author: 'GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>'
4547
4648 steps :
47- - name : Validate deployment environment
48- if : inputs.network != 'hardhat'
49+ - name : Validate target environment
50+ # if: inputs.network != 'hardhat'
4951 env :
5052 NETWORK : ${{ inputs.network }}
5153 STAGE : ${{ inputs.stage }}
@@ -101,7 +103,7 @@ jobs:
101103 npm run deploy -- --network ${{ inputs.network }}
102104
103105 - name : Push deployment artifacts to the current branch
104- if : inputs.network != 'hardhat' && github.ref != 'refs/heads/main'
106+ if : github.ref != 'refs/heads/main'
105107 uses : stefanzweifel/git-auto-commit-action@v5
106108 with :
107109 commit_message : ${{ env.COMMIT_MESSAGE }}
@@ -112,7 +114,7 @@ jobs:
112114
113115 # Since `main` branch is protected, create a PR to push deployment files.
114116 - name : Push deployment artifacts through a pull request
115- if : inputs.network != 'hardhat' && github.ref == 'refs/heads/main'
117+ if : github.ref == 'refs/heads/main'
116118 uses : peter-evans/create-pull-request@v7
117119 with :
118120 commit-message : ${{ env.COMMIT_MESSAGE }}
0 commit comments