Merge pull request #225 from covalenthq/dependabot/go_modules/golang.… #859
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
name: docker-image | |
on: | |
push: | |
branches: | |
- "main" | |
pull_request: | |
branches: | |
- "main" | |
- "develop" | |
jobs: | |
bsp-agent-eth: | |
runs-on: ubuntu-latest | |
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 }} | |
- name: Login to GCR | |
uses: docker/login-action@v2 | |
with: | |
registry: gcr.io | |
username: _json_key | |
password: ${{ secrets.GCR_JSON_KEY }} | |
- uses: actions/checkout@v2 | |
- name: Build & Publish the Docker image | |
run: | | |
docker buildx create --name builder --use --platform=linux/amd64,linux/arm64 && docker buildx build --platform=linux/amd64,linux/arm64 . -t gcr.io/covalent-project/bsp-agent:latest --push | |
- name: Create .env file | |
run: | | |
touch .env | |
echo PRIVATE_KEY=${{ secrets.PRIVATE_KEY }} >> .env | |
echo RPC_URL=${{ secrets.RPC_URL }} >> .env | |
echo WEB3_JWT=${{ secrets.WEB3_JWT }} >> .env | |
cat .env | |
- name: Load .env file | |
uses: xom9ikk/[email protected] | |
- name: Run 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 & bin files | |
run: | | |
rm -rf .env && rm -rf ./bin/block-ethereum | |
- name: Stop containers | |
if: always() | |
run: docker-compose -f "docker-compose-ci.yml" down |