Skip to content

Merge pull request #119 from Tonomy-Foundation/feature/feature-vestin… #15

Merge pull request #119 from Tonomy-Foundation/feature/feature-vestin…

Merge pull request #119 from Tonomy-Foundation/feature/feature-vestin… #15

name: "Deploy to staging and build docker image"
on:
push:
branches:
- development
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-staging:
name: Deploy tonomy contract to staging
needs: build
runs-on: ubuntu-20.04
container: tonomy/antelope
environment: staging
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-development
- 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-development
- 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-development
- 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-development