Skip to content

Merge pull request #122 from Tonomy-Foundation/development #7

Merge pull request #122 from Tonomy-Foundation/development

Merge pull request #122 from Tonomy-Foundation/development #7

name: "Deploy to testnet and build docker image"
on:
push:
branches:
- testnet
jobs:
build:
name: Compile eosio.boot, eosio.bios and tonomy contracts
runs-on: ubuntu-20.04
container: tonomy/antelope
steps:
- uses: actions/checkout@v3
- name: Build eosio.boot contract
run: ./contracts/eosio.boot/build.sh local
- name: Build eosio.bios contract
run: ./contracts/eosio.bios/build.sh local
- name: Build tonomy contract
run: ./contracts/tonomy/build.sh local
- name: Add eosio.boot contracts to artifacts
uses: actions/upload-artifact@v3
with:
name: eosio.boot
path: ./contracts/eosio.boot
- name: Add eosio.bios contracts to artifacts
uses: actions/upload-artifact@v3
with:
name: eosio.bios
path: ./contracts/eosio.bios
- name: Add built contracts to artifacts
uses: actions/upload-artifact@v3
with:
name: tonomy
path: ./contracts/tonomy
deploy-testnet:
name: Deploy tonomy contract to testnet
needs: build
runs-on: ubuntu-20.04
container: tonomy/antelope
environment: testnet
env:
TONOMY_OPS_PRIVATE_KEY: ${{ secrets.TONOMY_OPS_PRIVATE_KEY }}
TONOMY_BOARD1_PRIVATE_KEY: ${{ secrets.TONOMY_BOARD1_PRIVATE_KEY }}
TONOMY_BOARD2_PRIVATE_KEY: ${{ secrets.TONOMY_BOARD2_PRIVATE_KEY }}
TONOMY_BOARD3_PRIVATE_KEY: ${{ secrets.TONOMY_BOARD3_PRIVATE_KEY }}
steps:
- name: Get built contracts from cache
uses: actions/download-artifact@v3
with:
name: tonomy
path: contracts/tonomy
- name: Deploy tonomy contract
run: |
cleos wallet create --file ./wallet.txt
cleos wallet import --private-key $TONOMY_OPS_PRIVATE_KEY
cleos wallet import --private-key $TONOMY_BOARD1_PRIVATE_KEY
cleos wallet import --private-key $TONOMY_BOARD2_PRIVATE_KEY
cleos wallet import --private-key $TONOMY_BOARD3_PRIVATE_KEY
ls ./contracts/tonomy
cleos -u "https://blockchain-api-staging.tonomy.foundation" set contract tonomy ./contracts/tonomy tonomy.wasm tonomy.abi -p tonomy@owner -p tonomy@active
push-docker:
name: Builds docker image and push to Docker Hub
needs: build
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Get eosio.boot contracts from cache
uses: actions/download-artifact@v3
with:
name: eosio.boot
path: contracts/eosio.boot
- name: Get eosio.bios contracts from cache
uses: actions/download-artifact@v3
with:
name: eosio.bios
path: contracts/eosio.bios
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./blockchain/Dockerfile
target: tonomy_blockchain_base
push: true
tags: tonomy/blockchain:base-rc
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./blockchain/Dockerfile
target: tonomy_blockchain_initialized
push: true
tags: tonomy/blockchain:initialized-rc
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./blockchain/Dockerfile
target: tonomy_blockchain_nodejs
push: true
tags: tonomy/blockchain:nodejs-rc
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: ./blockchain/Dockerfile
target: tonomy_blockchain_easycleos
push: true
tags: tonomy/blockchain:easycleos-rc