Bridge #20
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: Bridge | |
on: | |
workflow_run: | |
workflows: ["Release Tag"] | |
types: [completed] | |
workflow_dispatch: | |
inputs: | |
force: | |
description: 'Force execution of this action' | |
type: boolean | |
required: false | |
default: true | |
jobs: | |
Bridge: | |
runs-on: ubuntu-latest | |
environment: tags | |
if: ${{ github.event.workflow_run.conclusion == 'success' || inputs.force }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Protobuf | |
run: | | |
sudo apt install -y protobuf-compiler | |
protoc --version | |
- name: Build witnet-centralized-ethereum-bridge | |
run: | | |
cargo build -p witnet-centralized-ethereum-bridge --release | |
- name: Move file to outside docker ignored | |
run: | | |
cp target/release/witnet-centralized-ethereum-bridge ./ | |
- name: Set Version | |
run: | | |
echo VERNUM=$(sed -nE 's/version\s?=\s?"([0-9]+\.[0-9]\.[0-9])"/\1/p' ./bridges/centralized-ethereum/Cargo.toml | head -1) >> $GITHUB_ENV | |
- name: Build docker Image | |
run: | | |
docker build -t witnet/witnet-centralized-ethereum-bridge:"$VERNUM" -f ./docker/bridge/Dockerfile . | |
docker build -t witnet/witnet-centralized-ethereum-bridge:latest -f ./docker/bridge/Dockerfile . | |
docker image ls | |
- name: Login to Docker hub Registry | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Push Image | |
run: | | |
docker push witnet/witnet-centralized-ethereum-bridge:"$VERNUM" | |
docker push witnet/witnet-centralized-ethereum-bridge:latest | |
Failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: echo '(Release Tag) workflow failed, EXITING!!!!' && exit 1 |