-
Notifications
You must be signed in to change notification settings - Fork 46
55 lines (48 loc) · 2.09 KB
/
publish-docker-sidechain.yml
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
47
48
49
50
51
52
53
54
55
name: Publish Docker image for new sidechain release
on:
release:
types:
- published
jobs:
main:
name: Push Integritee Sidechain to Dockerhub
runs-on: [ self-hosted ]
steps:
- uses: actions/checkout@v3
- name: Download sidechain from release
uses: dsaltares/fetch-gh-release-asset@master
with:
version: "tags/${{ github.event.release.tag_name }}"
file: integritee-worker-sidechain-${{ github.event.release.tag_name }}.tar.gz
target: "integritee-worker-sidechain.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download sidechain cli from release
uses: dsaltares/fetch-gh-release-asset@master
with:
version: "tags/${{ github.event.release.tag_name }}"
file: sidechain-cli-${{ github.event.release.tag_name }}.tar.gz
target: "sidechain-cli.tar.gz"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Dockerhub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Load Worker & Push
env:
DOCKER_BUILDKIT: 1
run: |
docker image load --input integritee-worker-sidechain.tar.gz
docker push integritee/sidechain:${{ github.event.release.tag_name }}
docker image load --input sidechain-cli.tar.gz
docker push integritee/sidechain-cli:${{ github.event.release.tag_name }}
docker images --all
- name: Delete images
run: |
if [[ "$(docker images -q integritee/sidechain:${{ github.event.release.tag_name }} 2> /dev/null)" != "" ]]; then
docker image rmi --force integritee/sidechain:${{ github.event.release.tag_name }} 2>/dev/null
fi
if [[ "$(docker images -q integritee/sidechain-cli:${{ github.event.release.tag_name }} 2> /dev/null)" != "" ]]; then
docker image rmi --force integritee/sidechain-cli:${{ github.event.release.tag_name }} 2>/dev/null
fi
docker images --all