forked from Joystream/joystream
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 2.06 KB
/
joystream-node-docker-dev.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
# Development builds of joystream-node (staging, testing, playground)
# Only built for amd64 on ubuntu
name: joystream-node-docker(dev)
on:
- push
- workflow_dispatch
env:
REPOSITORY: joystream/node
jobs:
ubuntu:
name: Build joystream/node Docker image for amd64
runs-on: ubuntu-latest
strategy:
matrix:
runtime_profile: ['STAGING', 'PLAYGROUND', 'TESTING']
include:
- runtime_profile: 'STAGING'
cargo_features: 'staging-runtime'
- runtime_profile: 'PLAYGROUND'
cargo_features: 'playground-runtime'
- runtime_profile: 'TESTING'
cargo_features: 'testing-runtime'
env:
RUNTIME_PROFILE: ${{ matrix.runtime_profile }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- id: compute_shasum
name: Compute runtime code shasum
run: |
export RUNTIME_CODE_SHASUM=`scripts/runtime-code-shasum.sh`
echo "::set-output name=shasum::${RUNTIME_CODE_SHASUM}"
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Check if we have pre-built image on Dockerhub
id: compute_image_exists
# Will output 0 if image exists and 1 if does not exists
run: |
export IMAGE_EXISTS=$(docker manifest inspect ${{ env.REPOSITORY }}:${{ steps.compute_shasum.outputs.shasum }} > /dev/null ; echo $?)
echo "::set-output name=image_exists::${IMAGE_EXISTS}"
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
file: joystream-node.Dockerfile
platforms: linux/amd64
build-args: |
CARGO_FEATURES=${{ matrix.cargo_features }}
CODE_SHASUM=${{ steps.compute_shasum.outputs.shasum }}
push: true
tags: ${{ env.REPOSITORY }}:${{ steps.compute_shasum.outputs.shasum }}
if: ${{ steps.compute_image_exists.outputs.image_exists == 1 }}