-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (84 loc) · 2.84 KB
/
docker_hub_build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Docker Container Build
on:
workflow_dispatch:
push:
branches:
- master
tags:
- mainnet
- testnet
- mainnet_next
jobs:
build-production-docker-image:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set tag name
id: image_tag
shell: bash
run: |
export TAG_NAME=master
if [[ '${{github.ref_name}}' == 'mainnet' || '${{github.ref_name}}' == 'testnet' || '${{github.ref_name}}' == 'mainnet_next' ]];
then
export TAG_NAME=${{github.ref_name}}
if [[ $TAG_NAME == 'mainnet_next' ]]
then
export SPEC_NAME='mainnet'
else
export SPEC_NAME=$TAG_NAME
fi
fi
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
echo "SPEC_NAME=$SPEC_NAME" >> $GITHUB_OUTPUT
- name: "Build production ${{ steps.image_tag.outputs.TAG_NAME }} image"
if: steps.image_tag.outputs.TAG_NAME != 'master'
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
build-args: features=--features=${{ steps.image_tag.outputs.SPEC_NAME }},wasmtime
tags: docknetwork/dock-substrate:${{ steps.image_tag.outputs.TAG_NAME }}
build-fastblock-docker-image:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set tag name
id: image_tag
shell: bash
run: |
export TAG_NAME=master
if [[ '${{github.ref_name}}' == 'mainnet' || '${{github.ref_name}}' == 'testnet' || '${{github.ref_name}}' == 'mainnet_next' ]];
then
export TAG_NAME=${{github.ref_name}}
if [[ $TAG_NAME == 'mainnet_next' ]]
then
export SPEC_NAME='mainnet'
else
export SPEC_NAME=$TAG_NAME
fi
fi
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_OUTPUT
echo "SPEC_NAME=$SPEC_NAME" >> $GITHUB_OUTPUT
- name: "Build release fastblock_${{ steps.image_tag.outputs.TAG_NAME }} image"
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
build-args: |
features=--features=fastblock,wasmtime
release=Y
tags: docknetwork/dock-substrate:fastblock_${{ steps.image_tag.outputs.TAG_NAME }}