From 3e458bef646742fa3f9b79ec4f96401feb2e338f Mon Sep 17 00:00:00 2001 From: Giacomo Licari Date: Wed, 6 Sep 2023 11:44:35 +0200 Subject: [PATCH] Update Github Actions - build docker image and deploy to Github registry --- .github/workflows/main.yml | 16 +++++++--------- Dockerfile.e2e | 2 +- oracle/Dockerfile | 12 ++++++++---- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 359a5fed3..61c11e6e0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,13 +1,11 @@ name: tokenbridge -on: - workflow_dispatch: - branches: [develop] +on: [push] env: DOCKER_REGISTRY: docker.pkg.github.com - DOCKER_PULL_REPO: poanetwork/tokenbridge - DOCKER_PULL_IMAGE_BASE: docker.pkg.github.com/poanetwork/tokenbridge + DOCKER_REPO: gnosischain/tokenbridge + DOCKER_IMAGE_BASE: docker.pkg.github.com/gnosischain/tokenbridge jobs: initialize: @@ -79,7 +77,7 @@ jobs: - name: Rebuild and push updated images run: | function check_if_image_exists() { - curl -fsSlL "https://${{ github.actor }}:${{ github.token }}@${DOCKER_REGISTRY}/v2/${DOCKER_PULL_REPO}/tokenbridge-e2e-$1/manifests/$2" > /dev/null + curl -fsSlL "https://${{ github.actor }}:${{ github.token }}@${DOCKER_REGISTRY}/v2/${DOCKER_REPO}/tokenbridge-e2e-$1/manifests/$2" > /dev/null } updated=() if ! check_if_image_exists e2e ${E2E_TAG}; then updated+=("e2e"); fi @@ -106,7 +104,7 @@ jobs: - name: Rebuild and push molecule runner e2e image run: | function check_if_image_exists() { - curl -fsSlL "https://${{ github.actor }}:${{ github.token }}@${DOCKER_REGISTRY}/v2/${DOCKER_PULL_REPO}/tokenbridge-e2e-$1/manifests/$2" > /dev/null + curl -fsSlL "https://${{ github.actor }}:${{ github.token }}@${DOCKER_REGISTRY}/v2/${DOCKER_REPO}/tokenbridge-e2e-$1/manifests/$2" > /dev/null } if check_if_image_exists molecule_runner ${MOLECULE_RUNNER_TAG}; then echo "Image already exists" @@ -211,7 +209,7 @@ jobs: - name: Pull e2e oracle image run: | docker-compose -f ./e2e-commons/docker-compose.yml pull oracle-amb - docker tag ${DOCKER_PULL_IMAGE_BASE}/tokenbridge-e2e-oracle:${ORACLE_TAG} gnosischain/tokenbridge-oracle:latest + docker tag ${DOCKER_IMAGE_BASE}/tokenbridge-e2e-oracle:${ORACLE_TAG} gnosischain/tokenbridge-oracle:latest - name: Deploy oracle run: deployment-e2e/molecule.sh ultimate-${{ matrix.task }} - name: Reset docker socket permissions @@ -226,4 +224,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: logs-ultimate-${{ matrix.task }} - path: e2e-commons/logs + path: e2e-commons/logs \ No newline at end of file diff --git a/Dockerfile.e2e b/Dockerfile.e2e index 715a4cd0a..573dedec4 100644 --- a/Dockerfile.e2e +++ b/Dockerfile.e2e @@ -30,4 +30,4 @@ RUN yarn install:deploy COPY commons/ ./commons/ COPY oracle-e2e/ ./oracle-e2e/ COPY monitor-e2e/ ./monitor-e2e/ -COPY e2e-commons/ ./e2e-commons/ +COPY e2e-commons/ ./e2e-commons/ \ No newline at end of file diff --git a/oracle/Dockerfile b/oracle/Dockerfile index 52a53b0bd..cac5bfc1b 100644 --- a/oracle/Dockerfile +++ b/oracle/Dockerfile @@ -13,9 +13,13 @@ RUN npm run compile FROM node:12 -RUN apt-get update && \ - apt-get install -y build-essential libc6-dev libc6-dev-i386 wget && \ - apt-get clean +RUN echo "deb http://archive.debian.org/debian stretch main" > /etc/apt/sources.list +RUN apt-get update +RUN apt-get install -y build-essential +RUN apt-get install -y libc6-dev +RUN apt-get install -y libc6-dev-i386 +RUN apt-get install -y wget +RUN apt-get clean WORKDIR /mono COPY package.json . @@ -30,4 +34,4 @@ COPY ./oracle ./oracle WORKDIR /mono/oracle CMD echo "To start a bridge process run:" \ - "ORACLE_VALIDATOR_ADDRESS= ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY= docker-compose up -d --build" + "ORACLE_VALIDATOR_ADDRESS= ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY= docker-compose up -d --build" \ No newline at end of file