-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* deployment dockerization * private ECR * ref: scripts are runnable standalone * feat: add default signers & set-whitelisting off * 2.4.3
- Loading branch information
Showing
33 changed files
with
1,420 additions
and
4,467 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Build and push docker image when tagged with v[0-9]* or when pushed to dev branch | ||
|
||
name: Build & Push Docker on Push | ||
|
||
on: | ||
push: | ||
tags: | ||
- v[0-9]* | ||
branches: | ||
- dev | ||
|
||
env: | ||
KEY: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' | ||
KEY2: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' | ||
KEY3: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Hardhat unit tests | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
- name: Install the dependencies | ||
run: npm install | ||
- name: Run the tests | ||
run: npm run coverage | ||
build: | ||
name: Build and push Docker image | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.TF_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.TF_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
- name: Login to Amazon ECR Public | ||
id: login-ecr-public | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
with: | ||
registry-type: public | ||
- name: Login to Amazon ECR | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
- name: Set outputs | ||
id: vars | ||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- name: Build and push Docker image | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_PUBLIC_REGISTRY: ${{ steps.login-ecr-public.outputs.registry }} | ||
REGISTRY_ALIAS: dlc-link | ||
ECR_REPOSITORY: dlc-solidity | ||
IMAGE_TAG: ${{ github.ref_name }} | ||
run: | | ||
docker build -t $ECR_PUBLIC_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:$IMAGE_TAG -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | ||
docker push $ECR_PUBLIC_REGISTRY/$REGISTRY_ALIAS/$ECR_REPOSITORY:$IMAGE_TAG | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Hardhat Tests & ECR Private | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- dev | ||
- master | ||
types: | ||
- opened | ||
- reopened | ||
- synchronize | ||
|
||
env: | ||
KEY: '0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80' | ||
KEY2: '0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d' | ||
KEY3: '0x5de4111afa1a4b94908f83103eb1f1706367c2e68ca870fc3fb9a804cdab365a' | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
name: Hardhat unit tests | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
- name: Install the dependencies | ||
run: npm install | ||
- name: Run the tests | ||
run: npm run coverage | ||
|
||
# This will push a temp image to ECR private | ||
build: | ||
name: Build and push Docker image | ||
runs-on: ubuntu-latest | ||
needs: [test] | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.TF_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.TF_AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
- name: Login to Amazon ECR Public | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
- name: Set outputs | ||
id: vars | ||
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | ||
- name: Build and push Docker image | ||
env: | ||
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | ||
ECR_REPOSITORY: dlc-solidity | ||
IMAGE_TAG: test-${{ steps.vars.outputs.sha_short }} | ||
run: | | ||
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . | ||
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.