publish-docker.yml 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. name: Publish Docker
  2. on:
  3. pull_request:
  4. branches:
  5. - 'develop'
  6. - 'master'
  7. jobs:
  8. docker:
  9. runs-on: ubuntu-latest
  10. steps:
  11. - name: Checkout
  12. uses: actions/checkout@v2
  13. - name: Set up QEMU
  14. uses: docker/setup-qemu-action@v1
  15. - name: Set up Docker Buildx
  16. uses: docker/setup-buildx-action@v1
  17. - name: Login to DockerHub
  18. uses: docker/login-action@v1
  19. with:
  20. username: ${{ secrets.DOCKERHUB_USERNAME }}
  21. password: ${{ secrets.DOCKERHUB_TOKEN }}
  22. - name: Build and push latest
  23. if: github.base_ref == 'master'
  24. uses: docker/build-push-action@v2
  25. with:
  26. context: .
  27. platforms: linux/amd64, linux/arm64
  28. push: true
  29. tags: |
  30. gravitl/netmaker:latest
  31. - name: Build and push develop
  32. if: github.base_ref == 'develop'
  33. uses: docker/build-push-action@v2
  34. with:
  35. context: .
  36. platforms: linux/amd64, linux/arm64
  37. push: true
  38. tags: |
  39. gravitl/netmaker:develop