forked from witnet/witnet-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (37 loc) · 1.65 KB
/
Copy pathbridge.yml
File metadata and controls
46 lines (37 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Bridge
on:
workflow_dispatch:
branches: [master]
jobs:
Bridge:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check & Compare Version
run: |
cd bridges/centralized-ethereum
export TERM=xterm-256color
export VERSION=$(awk '/^version/' Cargo.toml | head -n 1 | awk '{print $3}' | tr -d '"')
export RESULT=$(wget -q https://registry.hub.docker.com/v1/repositories/witnet/witnet-centralized-ethereum-bridge/tags -O - | sed -e 's/[][]//g' -e 's/"//g' -e 's/ //g' | tr '}' '\n' | awk -F: '{print $3}' | grep $VERSION)
if [ ! -z $RESULT ]; then tput setaf 1; echo "VERSION IS ALREADY PUBLISHED" && exit 1; else true; fi;
echo "IMAGE_VERSION=$VERSION" >> $GITHUB_ENV
- 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: Build docker Image
run: docker build -t witnet/witnet-centralized-ethereum-bridge:"${{ env.IMAGE_VERSION }}" -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:"${{ env.IMAGE_VERSION }}"