Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
0853905
feat(upload):refactor code for file upload/update/delete, and add res…
cnlangzi May 27, 2021
f8ed134
fix(gomod):removed go mod replace
cnlangzi May 27, 2021
dba705b
fix(merkle): renamed StreamingMerklHasher with StreamMerklHasher
cnlangzi May 28, 2021
280928b
fix(upload): updated fields on ResumeFileChange
cnlangzi Jun 3, 2021
8705b0f
Merge branch 'master' into feature/continuous_upload
cnlangzi Jun 3, 2021
b497a94
fix(devserver):#145 added devserver feature on blobber and validtor; …
cnlangzi Jun 4, 2021
afb6db2
fix(devserver):wrapped transaction.MakeSCRestAPICall with middleware
cnlangzi Jun 4, 2021
d6d85b9
fix(upload): fixed reload state of allocationChange from db
cnlangzi Jun 8, 2021
c66b448
fix(upload):added to improve build performance;enabled FullSaveAssoc…
cnlangzi Jun 9, 2021
aea90b5
fix(devserver):#145 added ./dev.local/cli.sh to run blobber & validat…
cnlangzi Jun 11, 2021
4721c8e
fix(devserver):#145 fixed typo
cnlangzi Jun 11, 2021
f8d70ff
fix(devserver):#145 added guideline link on README.md
cnlangzi Jun 11, 2021
4c861be
fix(devserver):#145 added build tags was missing
cnlangzi Jun 11, 2021
306b6dd
fix(devserver):#145 fixed bug on log_dir, files_dir and db_dir
cnlangzi Jun 11, 2021
c3161ef
fix(devserver):#145 added install debuggers
cnlangzi Jun 11, 2021
bfa366c
fix(devserver):#145 fixed typo
cnlangzi Jun 11, 2021
86a8ee4
fix(devserver):#145 fixed bugs on validator
cnlangzi Jun 11, 2021
2246567
Merge branch 'master' into feature/continuous_upload
cnlangzi Jun 11, 2021
9951887
fix(upload):0chain/blobber#111 disable go replace for gosdk
cnlangzi Jun 11, 2021
a1774d9
fix(upload):#111 drop devserver part
cnlangzi Jun 11, 2021
849936e
fix(upload):#111 drop devserver on cli.sh
cnlangzi Jun 11, 2021
c10d4a4
Merge pull request #206 from cnlangzi/feature/continuous_upload
cnlangzi Jun 12, 2021
36cb043
fix(upload): removed debugging code
geax Jun 12, 2021
f6730f7
Merge branch 'feature/stream_upload' into dayi/main
Jun 15, 2021
f090538
fix(devops):0chain/gosdk#107 added github actions for CI/CD
cnlangzi Jun 17, 2021
1b0bad1
fix(devops):0chain/gosdk#107 fixed build.validator.sh and gosdk repo url
cnlangzi Jun 17, 2021
cfa7561
fix(devops):0chain/gosdk#107 fixed gosdk path and disable ci jobs on …
cnlangzi Jun 17, 2021
430d1be
fix(go):removed fmt in debugging
cnlangzi Jun 17, 2021
4e6e070
fix(devops):0chain/gosdk#107 remove gosdk before git clone
cnlangzi Jun 17, 2021
a07e89f
fix(devops):0chain/gosdk#107 debug git clone issue
cnlangzi Jun 17, 2021
7c658ae
fix(devops):0chain/gosdk#107 fixed git clone with branch bug
cnlangzi Jun 17, 2021
3904d8d
fix(devops):0chain/gosdk#107 used short GITHUB_SHA instead of latest …
cnlangzi Jun 17, 2021
bd7c0b3
fix(devops):0chain/gosdk#107 use - instead of latest on docker registry
cnlangzi Jun 17, 2021
dad830a
fix(upload): 0chain/zboxcli#36 update connection size bugs when a chu…
cnlangzi Jun 19, 2021
8cae726
fix(git):merge latest code from master
cnlangzi Jun 19, 2021
251c354
fix(git):fixed build scripts about syntax error
cnlangzi Jun 19, 2021
208ad64
fix(dev): added network issue fix script for MacOS
cnlangzi Jun 21, 2021
0dab859
fix(dev): update ip detection
cnlangzi Jun 21, 2021
0443876
fix(upload&download): 0chain/zboxcli:#37 added chunksize parameter on…
cnlangzi Jun 23, 2021
e881235
Merge branch 'master' into dayi/main
cnlangzi Jun 23, 2021
ac7d9c8
fix(upload&download): 0chain/zboxcli#36 removed transaction on migrat…
cnlangzi Jun 29, 2021
3c5060a
fix(liveupload):0chain/zboxcli#54 removed code for debugging
cnlangzi Jul 9, 2021
6c83cbe
fix(git):0chain/zboxcli#54 merge lastest code from master
cnlangzi Jul 9, 2021
7376fb2
fix(git):merge lastest master
cnlangzi Jul 14, 2021
7390120
fix(devops):fixed package bug on dockerfile
cnlangzi Jul 14, 2021
4b1b20b
fix(devops):fixed package bug on dockerfile
cnlangzi Jul 14, 2021
cf8d2ed
fix(devops):fixed package bug on dockerfile
cnlangzi Jul 14, 2021
0cd4cfc
fix(cli):added se-hostname
cnlangzi Jul 16, 2021
c4c10f8
fix(cli):added change_zcn
cnlangzi Jul 16, 2021
963463f
fix(cli):skip change zcn if it is blank
cnlangzi Jul 16, 2021
ddf897d
feat(cli):fixed validator config
cnlangzi Jul 22, 2021
fa325a4
feat(git):merged latest code from master
cnlangzi Jul 22, 2021
220d48a
fix(cli):updated logs for cli
cnlangzi Aug 3, 2021
396eecc
fix(git):merged latest code from master
cnlangzi Aug 3, 2021
57715f3
fix(git):merge latest code from master
cnlangzi Aug 5, 2021
68eea6a
fix(challeng):rename ValidationTickets stuff
cnlangzi Aug 13, 2021
80e56c6
fix(git):merge lastest code from master
cnlangzi Aug 14, 2021
f6396c0
fix(challenge):remove unsed comment
cnlangzi Aug 14, 2021
a660887
Merge branch 'fix/min_confimation' into dayi/main
cnlangzi Aug 14, 2021
ae9906b
Merge branch 'fix/min_confimation' into dayi/main
cnlangzi Aug 16, 2021
f737038
Merge branch 'fix/min_confimation' into dayi/main
cnlangzi Aug 16, 2021
914efcd
Merge branch 'fix/min_confimation' into dayi/main
cnlangzi Aug 16, 2021
2c2ebba
Merge branch 'fix/min_confimation' into dayi/main
cnlangzi Aug 16, 2021
536faa4
Merge branch 'master' into dayi/main
cnlangzi Aug 16, 2021
ef57d88
fix(test):fixed unit test
cnlangzi Aug 16, 2021
8c1c036
fix(docs): added comment
cnlangzi Aug 23, 2021
9a97ca1
Merge branch 'master' into dayi/main
cnlangzi Aug 23, 2021
6b8c825
fix(core): rename merkletree
cnlangzi Aug 24, 2021
73f1728
fix(upload): normalized names
cnlangzi Aug 25, 2021
32f9ab1
fix(upload): added ChunkHash in FormData
cnlangzi Aug 25, 2021
e86c31b
fix(download): removed ChunkSize from GetFileBlock
cnlangzi Aug 25, 2021
a63c5d1
fix(upload): Added chunk_size in GetFileBlockForChallenge
cnlangzi Aug 25, 2021
273061e
fix(challenge):moved syncChallenge to a new worker
cnlangzi Aug 25, 2021
ee28053
fix(challenge):got challenge worked with custom chunk_size and <1M file
cnlangzi Aug 26, 2021
65a6f3b
fix(challenge):fixed typo
cnlangzi Aug 26, 2021
c0b88e7
Merge branch 'master' into dayi/main
cnlangzi Aug 27, 2021
05edc00
fix(tests):fixed unit tests for CalculateHash with ChunkSize
cnlangzi Aug 27, 2021
840c8f5
fix(tests):enabled ci.yml for dayi/*
cnlangzi Aug 27, 2021
5800656
fix(tests):git clone gosdk instead of gomod
cnlangzi Aug 27, 2021
ec3e06e
fix(tests):fixed golangci-lint issue
cnlangzi Aug 27, 2021
2c6db2f
fix(tests):fixed integration-tests
cnlangzi Aug 27, 2021
ee4f869
fix(tests):fixed integration-tests for ChunkSize
cnlangzi Aug 27, 2021
febbe36
fix(tests):fixed integration-tests for ChunkSize
cnlangzi Aug 27, 2021
c9490fa
fix(upload): refactored AddFileChange
cnlangzi Sep 2, 2021
8bdbeea
fix(upload): moved context key from blobber/core/contants to gosdk/co…
cnlangzi Sep 2, 2021
10f9bfb
fix(update): refactored Update with ChunkedUpload
cnlangzi Sep 2, 2021
24e23b2
fix(challenge): added recover in challenge worker
cnlangzi Sep 2, 2021
65a3c87
fix(tests): fixed unit tests
cnlangzi Sep 2, 2021
749b9a6
fix(worker): added recover in workers
cnlangzi Sep 2, 2021
3fbddbd
fix(worker): added recover in LoadValidationTickets
cnlangzi Sep 2, 2021
5837b0a
fix(update): refactored Update with ChunkedUpload
cnlangzi Sep 3, 2021
6106e0f
fix(upload): fixed typo issue
cnlangzi Sep 7, 2021
56de984
fix(git): merged latest code from master
cnlangzi Sep 7, 2021
8c3b195
fix(git):tidy gomod
cnlangzi Sep 15, 2021
ec6af1b
fix(git):merged latest code from staging
cnlangzi Sep 15, 2021
cfa4da2
fix(datastore): added sqlmock and mocket for Store
cnlangzi Sep 16, 2021
a56ddb9
fix(datastore): fixed golangci-lint issues
cnlangzi Sep 16, 2021
989c703
fix(datastore): fixed integration_tests
cnlangzi Sep 16, 2021
6beb7c1
fix(datastore): fixed integration_tests
cnlangzi Sep 16, 2021
70663db
fix(datastore): fixed integration_tests
cnlangzi Sep 16, 2021
81ff7e0
fix(datastore): set timeout_minutes for integration_tests
cnlangzi Sep 16, 2021
e05f936
fix(upload): added BenchmarkUploadFile
cnlangzi Sep 17, 2021
e6995c8
fix(golang):upgraded go with 1.16 in github actions
cnlangzi Sep 17, 2021
a1890b4
fix(golangci): fixed golangci issues
cnlangzi Sep 17, 2021
4eb8ddf
fix(golang):upgraded go with 1.17 in dockerfile
cnlangzi Sep 17, 2021
c6b449d
fix(golang):upgraded docker images with golang:1.17.1-alpine3.14
cnlangzi Sep 17, 2021
b53a0b7
fix(golang):upgraded docker images with golang:1.17.1-alpine3.14
cnlangzi Sep 17, 2021
48518ac
fix(upload): added BenchmarkUploadFileWithNoDisk
cnlangzi Sep 17, 2021
7840eb2
fix(devops): test integration-tests
cnlangzi Sep 18, 2021
fe4d6c1
fix(devops): test integration-tests
cnlangzi Sep 18, 2021
3cfee42
fix(devops): run integration-tests with non-root
cnlangzi Sep 18, 2021
215cf59
fix(devops): run integration-tests with non-root
cnlangzi Sep 18, 2021
9c2c5c9
fix(devops): fixed Makefile with tag instead space
cnlangzi Sep 18, 2021
368816e
fix(upload): updated BenchmarkUploadFile
cnlangzi Sep 18, 2021
c8302a9
fix(devops): fixed file permission for integration-tests
cnlangzi Sep 18, 2021
f203d47
fix(devops): fixed file permission and removed action-docker-layer-ca…
cnlangzi Sep 18, 2021
29119fb
fix(devops): test integration-tests
cnlangzi Sep 18, 2021
ccf8ed5
fix(devops): test integration-tests
cnlangzi Sep 18, 2021
6e858e8
fix(devops): test integration-tests
cnlangzi Sep 18, 2021
28b28ab
fix(gomod): import gosdk v1.2.87-beat.1 via gomod
cnlangzi Sep 19, 2021
cf59f21
fix(gomod): import gosdk v1.2.87-beat.1 via gomod
cnlangzi Sep 19, 2021
4af0315
fix(gomod): import gosdk v1.2.87-beat.1 via gomod in docker build
cnlangzi Sep 19, 2021
f979c44
fix(docker): remove copy .gosdk
cnlangzi Sep 19, 2021
bdbea3f
fix(gomod): upgraded gosdk with v1.2.88
cnlangzi Sep 23, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Benchmark tests

on:
push:
# branches: [ master ]
pull_request:
# branches: [ master ]

jobs:
benchmark:
runs-on: ubuntu-latest
steps:

- name: Setup go 1.16
uses: actions/setup-go@v2
with:
go-version: '1.16' # The Go version to download (if necessary) and use.


- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV

- name: Clone blobber
uses: actions/checkout@v2

# - name: Clone gosdk
# run: |
# [ -d $GOSDK ] && rm -rf $GOSDK
# git clone https://github.com/0chain/gosdk.git $GOSDK
# cd $GOSDK
# git checkout $BRANCH

- name: Run benchmark
run: go test -tags bn256 -benchmem -run="BenchmarkUploadFile*" -bench="BenchmarkUploadFile*" ./... | tee benchmark.txt

# Run `github-action-benchmark` action
# - name: Push benchmark report
# uses: cnlangzi/github-action-benchmark@v1
# with:
# name: 0chain/gosdk Benchmark
# tool: 'go'
# benchmark-data-dir-path: ${{ env.TAG }}/bench
# output-file-path: benchmark.txt
# # Personal access token to deploy GitHub Pages branch
# github-token: ${{ secrets.GOSDK }}
# #github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
# # Push and deploy GitHub pages branch automatically
# auto-push: true
67 changes: 57 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI

on:
push:

release:
types:
- published
Expand All @@ -14,31 +15,76 @@ env:
VALIDATOR_REGISTRY: ${{ secrets.VALIDATOR_REGISTRY }}

jobs:
test:
integration_test:
runs-on: ubuntu-20.04
timeout-minutes: 40
steps:
- name: Install Go

- name: Setup go 1.16
uses: actions/setup-go@v2
with:
go-version: 1.13.x
- uses: actions/checkout@v2
- uses: satackey/action-docker-layer-caching@v0.0.11
continue-on-error: true
go-version: '1.16' # The Go version to download (if necessary) and use.

- name: Clone Blobber
uses: actions/checkout@v2

# - uses: satackey/action-docker-layer-caching@v0.0.11
# continue-on-error: true


- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV

# git clone gosdk with same branch
# - name: Clone gosdk
# run: |
# [ -d $GOSDK ] && rm -rf $GOSDK
# git clone https://github.com/0chain/gosdk.git $GOSDK
# cd $GOSDK
# git checkout $BRANCH

- name: Build test environment and run tests
run: |
sed -i '/#expose_ci_port/c\ ports:\n - "5432:5432"' ./docker.local/b0docker-compose.yml
./docker.local/bin/blobber.init.setup.sh
docker network create --driver=bridge --subnet=198.18.0.0/15 --gateway=198.18.0.255 testnet0
./docker.local/bin/build.base.sh
./docker.local/bin/build.blobber.sh
./docker.local/bin/build.validator.sh
cd docker.local/blobber1
../bin/blobber.start_bls.sh </dev/null &>/dev/null &
cd ../..
make integration-tests

go16=$(which go)
sudo $go16 test ./... -args integration;
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- name: Setup go 1.16
uses: actions/setup-go@v2
with:
go-version: '1.16' # The Go version to download (if necessary) and use.
- uses: actions/checkout@v2


- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV

# git clone gosdk with same branch
# - name: Clone gosdk
# run: |
# [ -d $GOSDK ] && rm -rf $GOSDK
# git clone https://github.com/0chain/gosdk.git $GOSDK
# cd $GOSDK
# git checkout $BRANCH

- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
Expand All @@ -52,18 +98,19 @@ jobs:
uses: actions/checkout@master
with:
fetch-depth: 1

- name: setup golang
if: success()
uses: actions/setup-go@v2
with:
go-version: 1.13.x
go-version: 1.16.x
- name: run buf commands
if: success()
run: make local

dockerize_blobber:
runs-on: ubuntu-20.04
needs: test
needs: integration_test
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v2
Expand All @@ -87,7 +134,7 @@ jobs:

dockerize_validator:
runs-on: ubuntu-20.04
needs: test
needs: integration_test
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v2
Expand Down
219 changes: 219 additions & 0 deletions .github/workflows/dockerize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
name: Dockerize

on:
push:
branches:
- dayi/main
- dayi/qa
- dayi/dev
pull_request:
- dayi/main
- dayi/qa
- dayi/dev
# tags:
# - '*'


env:
BLOBBER_REGISTRY: ${{ secrets.BLOBBER_REGISTRY }}
VALIDATOR_REGISTRY: ${{ secrets.VALIDATOR_REGISTRY }}

jobs:
build_base:
runs-on: ubuntu-20.04
steps:
- name: Setup go 1.16
uses: actions/setup-go@v2
with:
go-version: '1.16' # The Go version to download (if necessary) and use.
- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV
- name: Clone blobber
uses: actions/checkout@v2

# - name: Clone gosdk
# run: |
# [ -d $GOSDK ] && rm -rf $GOSDK
# git clone https://github.com/0chain/gosdk.git $GOSDK
# cd $GOSDK
# git checkout $BRANCH


- name: Build blobber_base
run: ./docker.local/bin/build.base.sh

- name: Export blobber_base
run: |
mkdir -p /tmp/0chain/
docker save "blobber_base" > /tmp/0chain/blobber_base.tar

- name: Upload blobber_base
uses: actions/upload-artifact@v2
with:
name: blobber_base
path: /tmp/0chain/blobber_base.tar

build_blobber:
needs: build_base
runs-on: ubuntu-20.04
steps:
- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV

- name: Clone blobber
uses: actions/checkout@v2

# - name: Clone gosdk
# run: |
# [ -d $GOSDK ] && rm -rf $GOSDK
# git clone https://github.com/0chain/gosdk.git $GOSDK
# cd $GOSDK
# git checkout $BRANCH

- name: Download blobber_base
uses: actions/download-artifact@v2
with:
name: blobber_base
path: /tmp/0chain

- name: Load blobber_base
run: |
docker load --input /tmp/0chain/blobber_base.tar

#docker image ls -a

- name: Build blobber
run: ./docker.local/bin/build.blobber.sh

- name: Export blobber
run: |
mkdir -p /tmp/0chain/
docker save "blobber" > /tmp/0chain/blobber.tar

- name: Upload blobber
uses: actions/upload-artifact@v2
with:
name: blobber
path: /tmp/0chain/blobber.tar

publish_blobber:
needs: build_blobber
runs-on: ubuntu-20.04
steps:
- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV

- name: Download blobber
uses: actions/download-artifact@v2
with:
name: blobber
path: /tmp/0chain

- name: Load blobber
run: |
docker load --input /tmp/0chain/blobber.tar

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push blobber
run: |
docker tag blobber:latest ${BLOBBER_REGISTRY}:$TAG
docker push ${BLOBBER_REGISTRY}:$TAG

SHORT_SHA=$(echo $GITHUB_SHA | head -c 8)
docker tag blobber:latest ${BLOBBER_REGISTRY}:$TAG-$SHORT_SHA
docker push ${BLOBBER_REGISTRY}:$TAG-$SHORT_SHA



build_validator:
needs: build_base
runs-on: ubuntu-20.04
steps:
- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV

- name: Clone blobber
uses: actions/checkout@v2

# - name: Clone gosdk
# run: |
# [ -d $GOSDK ] && rm -rf $GOSDK
# git clone https://github.com/0chain/gosdk.git $GOSDK
# cd $GOSDK
# git checkout $BRANCH

- name: Download blobber_base
uses: actions/download-artifact@v2
with:
name: blobber_base
path: /tmp/0chain

- name: Load blobber_base
run: |
docker load --input /tmp/0chain/blobber_base.tar

#docker image ls -a

- name: Build validator
run: ./docker.local/bin/build.validator.sh

- name: Export validator
run: |
mkdir -p /tmp/0chain/
docker save "validator" > /tmp/0chain/validator.tar

- name: Upload validator
uses: actions/upload-artifact@v2
with:
name: validator
path: /tmp/0chain/validator.tar

publish_validator:
needs: build_validator
runs-on: ubuntu-20.04
steps:
- name: Set GITHUB_ENV
run: |
echo "BRANCH=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV
echo "GOSDK=$(echo $(dirname $(pwd)))/gosdk" >> $GITHUB_ENV
echo "TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g' )" >> $GITHUB_ENV

- name: Download validator
uses: actions/download-artifact@v2
with:
name: validator
path: /tmp/0chain

- name: Load validator
run: |
docker load --input /tmp/0chain/validator.tar

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push validator
run: |
docker tag validator:latest ${VALIDATOR_REGISTRY}:$TAG
docker push ${VALIDATOR_REGISTRY}:$TAG

SHORT_SHA=$(echo $GITHUB_SHA | head -c 8)
docker tag validator:latest ${VALIDATOR_REGISTRY}:$TAG-$SHORT_SHA
docker push ${VALIDATOR_REGISTRY}:$TAG-$SHORT_SHA
Loading