From 5c4771f12a4e3ad83896391a399e462b00acbdad Mon Sep 17 00:00:00 2001 From: Swanny Date: Wed, 8 May 2024 15:37:14 -0400 Subject: [PATCH 1/2] feat(cd): adding cd for smart contracts --- .github/workflows/cd.yml | 52 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/cd.yml diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..970b06e --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,52 @@ +name: Release and Deploy Contract + +on: + push: + branches: + - main + workflow_dispatch: + inputs: + generate-tag: + description: 'Generate a new tag' + required: true + default: 'true' + custom-tag: + description: 'Custom tag to be used if generate-tag is false' + required: false + default: '' + network: + description: 'Network to deploy contract to' + required: true + default: 'holesky' + type: choice + options: + - holesky + environment: + description: 'Environment to deploy contract to' + required: true + default: 'dev' + type: choice + options: + - dev + +permissions: + packages: write + contents: write + +jobs: + auto-release: + uses: init4tech/actions/.github/workflows/auto-release.yml@main + with: + generate-tag: true + custom-tag: ${{ github.event.inputs.custom-tag }} + deploy-contract: + uses: init4tech/actions/.github/workflows/solidity-deployment.yml@main + needs: auto-release + with: + network: ${{ github.event.inputs.network }} + environment: ${{ github.event.inputs.environment }} + secrets: + aws-deployer-role: ${{ secrets.AWS_DEPLOYER_ROLE }} + holesky-kms-key-id: ${{ secrets.HOLESKY_DEPLOYER_KEY_ID }} + holesky-rpc-url: ${{ secrets.HOLESKY_RPC_URL }} + etherscan-api-key: ${{ secrets.ETHERSCAN_API_KEY }} \ No newline at end of file From 4efb727b241bc8b29f7ddd4b8e02fc982763c68f Mon Sep 17 00:00:00 2001 From: Swanny Date: Wed, 8 May 2024 15:50:51 -0400 Subject: [PATCH 2/2] fix(ci): adding parameter to specify the forge script name --- .github/workflows/cd.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 970b06e..531219d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -45,6 +45,7 @@ jobs: with: network: ${{ github.event.inputs.network }} environment: ${{ github.event.inputs.environment }} + forge-deployment-script: "DeployZenith" secrets: aws-deployer-role: ${{ secrets.AWS_DEPLOYER_ROLE }} holesky-kms-key-id: ${{ secrets.HOLESKY_DEPLOYER_KEY_ID }}