forked from parallel-finance/parallel
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (64 loc) · 2.03 KB
/
dockerimage.yml
File metadata and controls
67 lines (64 loc) · 2.03 KB
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
name: Docker Image
on:
push:
branches: [master]
tags:
- "v*"
- "staging*"
- "qa*"
jobs:
dockerimage:
if: github.repository == 'parallel-finance/parallel'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
bin: ["parallel"]
steps:
- name: Checkout github repo (+ download lfs dependencies)
uses: actions/checkout@v2
with:
lfs: true
submodules: true
fetch-depth: 2
- name: Checkout LFS objects
run: git lfs checkout
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Get GIT Tag
if: startsWith(github.ref, 'refs/tags/')
id: git_tag
run: echo ::set-output name=tag::${GITHUB_REF/refs\/tags\//}
- uses: haya14busa/action-cond@v1
id: docker_tag
with:
cond: ${{ startsWith(github.ref, 'refs/tags/') }}
if_true: ${{ steps.git_tag.outputs.tag }}
if_false: "latest"
- uses: marceloprado/has-changed-path@v1
id: has_changed_path
with:
paths: node/ runtime/ pallets/ resources/ primitives/ Dockerfile.release .github/
- name: Build and push
if: steps.has_changed_path.outputs.changed == 'true'
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile.release
push: true
platforms: linux/amd64
build-args: |
BIN=${{ matrix.bin }}
PROFILE=release
tags: ${{ secrets.DOCKERHUB_ORGNAME }}/${{ matrix.bin }}:${{ steps.docker_tag.outputs.value }}
- name: Image digest
if: steps.has_changed_path.outputs.changed == 'true'
run: echo ${{ steps.docker_build.outputs.digest }}