-
Notifications
You must be signed in to change notification settings - Fork 26
117 lines (93 loc) · 3.11 KB
/
docker.yaml
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Docker
on:
push:
branches:
- main
- release/*
paths:
- "starship/docker/**"
- ".github/workflows/docker.yaml"
pull_request:
branches:
- main
paths:
- "starship/docker/**"
- ".github/workflows/docker.yaml"
types: [opened, reopened, synchronize, ready_for_review]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-docker
cancel-in-progress: true
jobs:
build-push-types:
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
permissions:
packages: write
# subdirs of docker/ directory to build
strategy:
matrix:
build-type: [ "explorers", "faucet", "relayers", "starship" ]
max-parallel: 4
env:
DOCKER_REPO: ghcr.io/cosmology-tech/starship
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build
if: github.event_name == 'pull_request'
run: |
./starship/scripts/build-docker.sh --type ${{ matrix.build-type }} --process all --version all
- name: Build and push
if: github.event_name == 'push'
run: |
./starship/scripts/build-docker.sh --type ${{ matrix.build-type }} --process all --version all --push
- name: Force Build and Push for workflow dispatch
if: github.event_name == 'workflow_dispatch'
run: |
./starship/scripts/build-docker.sh --type ${{ matrix.build-type }} --process all --version all --push --force
build-push-chains:
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
permissions:
packages: write
env:
DOCKER_REPO: ghcr.io/cosmology-tech/starship
defaults:
run:
working-directory: starship
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build chains
if: github.event_name == 'pull_request'
run: |
cd docker/chains && ./build-docker-chains.sh --chain all --tag all
- name: Build and push all chains
if: github.event_name == 'push'
run: |
cd docker/chains && ./build-docker-chains.sh --chain all --tag all --push
- name: Force Build and Push for workflow dispatch
if: github.event_name == 'workflow_dispatch'
run: |
cd docker/chains && ./build-docker-chains.sh --chain all --tag all --push --force