-
Notifications
You must be signed in to change notification settings - Fork 20
63 lines (55 loc) · 1.88 KB
/
build-docker-with-args.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
name: Build docker with args
on:
workflow_dispatch:
inputs:
ref:
description: The commit SHA or tag for checking out code
default: ""
required: false
cargo_profile:
type: choice
description: which profile to use in cargo
options:
- release
- production
docker_tag:
description: The tag for the built docker image
required: true
args:
description: Args to pass to `cargo build`, e.g. --features=runtime-benchmarks
default: ""
required: false
env:
DOCKER_BUILDKIT: 1
jobs:
## build docker image of client binary with args ##
build-docker-with-args:
runs-on: ubuntu-22.04
steps:
- name: Checkout codes on ${{ github.event.inputs.ref || github.ref }}
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref || github.ref }}
fetch-depth: 0
- name: Build docker image
run: |
./parachain/scripts/build-docker.sh ${{ github.event.inputs.cargo_profile }} ${{ github.event.inputs.docker_tag }} "${{ github.event.inputs.args }}"
echo "============================="
docker images
- name: Dockerhub login
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push docker image
run: |
docker push litentry/litentry-parachain:${{ github.event.inputs.docker_tag }}
- name: Copy client binary to disk
run: |
docker cp $(docker create --rm litentry/litentry-parachain:${{ github.event.inputs.docker_tag }}):/usr/local/bin/litentry-collator .
- name: Upload the client binary
uses: actions/upload-artifact@v4
with:
name: litentry-collator
path: |
litentry-collator