-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Pranay Valson <pranay.valson@gmail.com>
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: elrond-build | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
bsp-agent-elrond: | ||
runs-on: ubuntu-latest | ||
env: | ||
BLOCKCHAIN: elrond | ||
steps: | ||
- name: Login to GitHub Container Registry | ||
if: ${{ !env.ACT }} | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ secrets.CR_USER }} | ||
password: ${{ secrets.CR_PAT }} | ||
|
||
- uses: actions/checkout@v2 | ||
- name: Build & Publish the Docker image | ||
if: ${{ !env.ACT }} | ||
run: | | ||
docker build . --file Dockerfile --tag ghcr.io/covalenthq/bsp-agent:latest | ||
docker push ghcr.io/covalenthq/bsp-agent:latest | ||
- name: Create .env file | ||
run: | | ||
touch .env | ||
echo PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} >> .env | ||
echo RPC_URL=${{ secrets.RPC_URL }} >> .env | ||
cat .env | ||
- name: Load .env file | ||
uses: xom9ikk/dotenv@v1.0.2 | ||
|
||
- name: Start containers | ||
run: docker-compose -f "docker-compose-ci.yml" up --build --remove-orphans --exit-code-from agent | ||
|
||
- name: Check running agent | ||
run: docker inspect bsp-agent | ||
|
||
- name: Check running containers | ||
run: docker ps | ||
|
||
- name: Delete .env file & bin files | ||
run: | | ||
rm -rf .env && rm -rf ./bin/block-elrond | ||
- name: Stop containers | ||
if: always() | ||
run: docker-compose -f "docker-compose-ci.yml" down |