Skip to content

Commit

Permalink
Added a path variable to the actions
Browse files Browse the repository at this point in the history
  • Loading branch information
emmanuelantony2000 committed Nov 26, 2024
1 parent 33d5b79 commit afa9a30
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 138 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ This GitHub Action allows you to automate smart contract deployments across mult

## 🛠️ Inputs

| Name | Description | Required |
| ---------------- | ---------------------------------- | -------- |
| `network` | List of networks to deploy on, with `chainId` and optional `blockNumber`. Example format provided below. | `true` |
| `deployCmd` | Command to deploy the contract, such as `make deploy`. | `true` |
| `buildbear_token`| Your BuildBear API token for authentication. | `true` |
| Name | Description | Required |
| ------------------ | -------------------------------------------------------------------------------------------------------- | -------- |
| `network` | List of networks to deploy on, with `chainId` and optional `blockNumber`. Example format provided below. | `true` |
| `deploy-command` | Command to deploy the contract, such as `make deploy`. | `true` |
| `buildbear-token` | Your BuildBear API token for authentication. | `true` |
| `working-directory`| Path to the directory containing the project. Default is the root directory. | `false` |

### Example `network` Input Format

Expand Down Expand Up @@ -67,7 +68,7 @@ jobs:

- name: Run BB Action CI
uses: BuildBearLabs/[email protected]
with:
with:
network: |
[
{
Expand All @@ -78,20 +79,20 @@ jobs:
"chainId": 10
}
]
deployCmd: "make deploy"
buildbear_token: "${{ secrets.BUILDBEAR_TOKEN }}"
deploy-command: "make deploy"
buildbear-token: "${{ secrets.BUILDBEAR_TOKEN }}"
```
> **Note:** Ensure that the `buildbear_token` is securely stored as a secret in your GitHub repository under `BUILDBEAR_TOKEN`.
> **Note:** Ensure that the `buildbear-token` is securely stored as a secret in your GitHub repository under `BUILDBEAR_TOKEN`.

## 📚 Tutorial

1. **Set up GitHub Secrets**: Add your BuildBear API token as a secret in your repository settings.
2. **Define Networks**: In the `network` input, specify the networks and optional block numbers for deployment.
3. **Add Deployment Command**: Define the deployment command under `deployCmd`.
3. **Add Deployment Command**: Define the deployment command under `deploy-command`.
4. **Run Workflow**: Trigger the workflow on push or any specified event to deploy contracts on the selected networks.

## 📘 Additional Notes

- Ensure the `deployCmd` matches the command in your project for deploying contracts.
- This action requires Node.js 20 (`node20`) to run the main deployment script.
- Ensure the `deploy-command` matches the command in your project for deploying contracts.
- This action requires Node.js 20 (`node20`) to run the main deployment script.
28 changes: 16 additions & 12 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
name: 'bb_ci'
description: 'automate smart contract deployments across multiple networks using BuildBear’s sandbox'
name: "bb_ci"
description: "automate smart contract deployments across multiple networks using BuildBear’s sandbox"

inputs:
network:
description: 'List of networks you want to deploy on'
description: "List of networks you want to deploy on"
required: true
deployCmd:
description: 'Command to deploy the contract'
deploy-command:
description: "Command to deploy the contract"
required: true
buildbear_token:
buildbear-token:
description: "Buildbear API token"
required: true
working-directory:
description: "Project directory"
required: false
default: "."

outputs:
deployments:
description: 'deployments logs'
description: "deployments logs"

runs:
using: 'node20'
main: 'index.js'
using: "node20"
main: "index.js"

branding:
icon: 'bold'
color: 'green'
icon: "bold"
color: "green"
Loading

0 comments on commit afa9a30

Please sign in to comment.