joystream-node-docker-dev.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Development builds of joystream-node (staging, testing, playground)
  2. # Only built for amd64 on ubuntu
  3. name: joystream-node-docker(dev)
  4. on: push
  5. env:
  6. REPOSITORY: joystream/node
  7. jobs:
  8. ubuntu:
  9. name: Build joystream/node Docker image for amd64
  10. runs-on: ubuntu-latest
  11. strategy:
  12. matrix:
  13. runtime_profile: ['STAGING', 'PLAYGROUND', 'TESTING']
  14. include:
  15. - runtime_profile: 'STAGING'
  16. cargo_features: 'staging_runtime'
  17. - runtime_profile: 'PLAYGROUND'
  18. cargo_features: 'playground_runtime'
  19. - runtime_profile: 'TESTING'
  20. cargo_features: 'testing_runtime'
  21. env:
  22. RUNTIME_PROFILE: ${{ matrix.runtime_profile }}
  23. steps:
  24. - name: Checkout
  25. uses: actions/checkout@v2
  26. - uses: actions/setup-node@v1
  27. with:
  28. node-version: '14.x'
  29. - id: compute_shasum
  30. name: Compute runtime code shasum
  31. run: |
  32. export RUNTIME_CODE_SHASUM=`scripts/runtime-code-shasum.sh`
  33. echo "::set-output name=shasum::${RUNTIME_CODE_SHASUM}"
  34. - name: Login to DockerHub
  35. uses: docker/login-action@v1
  36. with:
  37. username: ${{ secrets.DOCKERHUB_USERNAME }}
  38. password: ${{ secrets.DOCKERHUB_PASSWORD }}
  39. - name: Check if we have pre-built image on Dockerhub
  40. id: compute_image_exists
  41. # Will output 0 if image exists and 1 if does not exists
  42. run: |
  43. export IMAGE_EXISTS=$(docker manifest inspect ${{ env.REPOSITORY }}:${{ steps.compute_shasum.outputs.shasum }} > /dev/null ; echo $?)
  44. echo "::set-output name=image_exists::${IMAGE_EXISTS}"
  45. - name: Build and push
  46. uses: docker/build-push-action@v2
  47. with:
  48. context: .
  49. file: joystream-node.Dockerfile
  50. platforms: linux/amd64
  51. build-args: CARGO_FEATURES=${{ matrix.cargo_features }}
  52. push: true
  53. tags: ${{ env.REPOSITORY }}:${{ steps.compute_shasum.outputs.shasum }}
  54. if: ${{ steps.compute_image_exists.outputs.image_exists == 1 }}