Skip to content

Commit

Permalink
Update Github Actions - build docker image and deploy to Github registry
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Licari committed Sep 6, 2023
1 parent a48d88e commit 948a5e0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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
Expand All @@ -226,4 +224,4 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: logs-ultimate-${{ matrix.task }}
path: e2e-commons/logs
path: e2e-commons/logs
2 changes: 1 addition & 1 deletion Dockerfile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -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/
3 changes: 2 additions & 1 deletion oracle/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN npm run compile
FROM node:12

RUN apt-get update && \
apt-get install -y apt-transport-https && \
apt-get install -y build-essential libc6-dev libc6-dev-i386 wget && \
apt-get clean

Expand All @@ -30,4 +31,4 @@ COPY ./oracle ./oracle

WORKDIR /mono/oracle
CMD echo "To start a bridge process run:" \
"ORACLE_VALIDATOR_ADDRESS=<validator address> ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=<validator address private key> docker-compose up -d --build"
"ORACLE_VALIDATOR_ADDRESS=<validator address> ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=<validator address private key> docker-compose up -d --build"

0 comments on commit 948a5e0

Please sign in to comment.