companion-deploy.yml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Companion Deploy
  2. on:
  3. push:
  4. branches: [main]
  5. jobs:
  6. docker:
  7. name: DockerHub
  8. runs-on: ubuntu-latest
  9. env:
  10. DOCKER_BUILDKIT: 0
  11. COMPOSE_DOCKER_CLI_BUILD: 0
  12. steps:
  13. - name: Checkout sources
  14. uses: actions/checkout@v3
  15. - name: Docker meta
  16. id: docker_meta
  17. uses: crazy-max/ghaction-docker-meta@v1
  18. with:
  19. images: transloadit/companion
  20. tag-sha: true
  21. tag-match: |
  22. \d{1,3}.\d{1,3}.\d{1,3}
  23. - uses: docker/setup-buildx-action@v1
  24. - name: Log in to DockerHub
  25. uses: docker/login-action@v1
  26. with:
  27. username: ${{secrets.DOCKER_USERNAME}}
  28. password: ${{secrets.DOCKER_PASSWORD}}
  29. - name: Build and push
  30. uses: docker/build-push-action@v2
  31. with:
  32. push: true
  33. context: .
  34. file: Dockerfile
  35. tags: ${{ steps.docker_meta.outputs.tags }}
  36. labels: ${{ steps.docker_meta.outputs.labels }}
  37. heroku:
  38. name: Heroku
  39. runs-on: ubuntu-latest
  40. steps:
  41. - name: Checkout sources
  42. uses: actions/checkout@v3
  43. - name: Alter dockerfile
  44. run: |
  45. sed -i 's/^EXPOSE 3020$/EXPOSE $PORT/g' Dockerfile
  46. - name: Deploy to heroku
  47. uses: akhileshns/heroku-deploy@v3.12.12
  48. with:
  49. heroku_api_key: ${{secrets.HEROKU_API_KEY}}
  50. heroku_app_name: companion-demo
  51. heroku_email: ${{secrets.HEROKU_EMAIL}}
  52. usedocker: true