-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
265 additions
and
157 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,13 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
|
||
jobs: | ||
lint_test: | ||
uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@v0.3.0 | ||
with: | ||
run-build: true | ||
run-unit-tests: true |
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,118 @@ | ||
name: docker_publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- "main" | ||
- "dev" | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
lint_test: | ||
uses: babylonlabs-io/.github/.github/workflows/reusable_node_lint_test.yml@v0.3.0 | ||
with: | ||
run-build: true | ||
run-unit-tests: true | ||
|
||
docker_build: | ||
needs: [lint_test] | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
environment: [devnet, staging, testnet, mainnet-private, mainnet] | ||
environment: ${{ matrix.environment }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build Docker image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
tags: simple-staking:${{ github.sha }} | ||
outputs: type=docker,dest=/tmp/simple-staking-${{ matrix.environment }}.tar | ||
build-args: | | ||
NEXT_PUBLIC_MEMPOOL_API=${{ vars.NEXT_PUBLIC_MEMPOOL_API }} | ||
NEXT_PUBLIC_API_URL=${{ vars.NEXT_PUBLIC_API_URL }} | ||
NEXT_PUBLIC_NETWORK=${{ vars.NEXT_PUBLIC_NETWORK }} | ||
NEXT_PUBLIC_DISPLAY_TESTING_MESSAGES=${{ vars.NEXT_PUBLIC_DISPLAY_TESTING_MESSAGES }} | ||
- name: Upload Docker image to workspace | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: simple-staking-${{ matrix.environment }} | ||
path: /tmp/simple-staking-${{ matrix.environment }}.tar | ||
|
||
dockerhub_publish: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
environment: [devnet, staging, testnet, mainnet-private, mainnet] | ||
needs: ["docker_build"] | ||
steps: | ||
- name: Download Docker image from workspace | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: simple-staking-${{ matrix.environment }} | ||
path: /tmp/ | ||
|
||
- name: Load Docker image | ||
run: docker load -i /tmp/simple-staking-${{ matrix.environment }}.tar | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Push Docker image with SHA | ||
run: | | ||
docker tag simple-staking:${{ github.sha }} ${{ vars.DOCKERHUB_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }} | ||
docker push ${{ vars.DOCKERHUB_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }} | ||
- name: Push Docker image with Tag | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
docker tag simple-staking:${{ github.sha }} ${{ vars.DOCKERHUB_REGISTRY_ID }}/simple-staking:${{ github.ref_name }}-${{ matrix.environment }} | ||
docker push ${{ vars.DOCKERHUB_REGISTRY_ID }}/simple-staking:${{ github.ref_name }}-${{ matrix.environment }} | ||
ecr_publish: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
environment: [devnet, staging, testnet, mainnet-private, mainnet] | ||
needs: ["docker_build"] | ||
steps: | ||
- name: Download Docker image from workspace | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: simple-staking-${{ matrix.environment }} | ||
path: /tmp/ | ||
|
||
- name: Load Docker image | ||
run: docker load -i /tmp/simple-staking-${{ matrix.environment }}.tar | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ${{ vars.AWS_ECR_REGION }} | ||
|
||
- name: Login to Amazon ECR Private | ||
id: login-ecr | ||
uses: aws-actions/amazon-ecr-login@v2 | ||
|
||
- name: Push Docker image with SHA | ||
run: | | ||
docker tag simple-staking:${{ github.sha }} ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }} | ||
docker push ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.sha }}-${{ matrix.environment }} | ||
- name: Push Docker image with Tag | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
docker tag simple-staking:${{ github.sha }} ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.ref_name }}-${{ matrix.environment }} | ||
docker push ${{ vars.AWS_ECR_REGISTRY_ID }}/simple-staking:${{ github.ref_name }}-${{ matrix.environment }} |
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.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 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
Oops, something went wrong.