publish-docker.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. name: Publish Docker image
  2. on:
  3. push:
  4. branches: [main]
  5. release:
  6. types: [published]
  7. jobs:
  8. push_to_registry:
  9. name: Push Docker image to Docker Hub
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Check out the repo
  13. uses: actions/checkout@v2
  14. - name: Log in to Docker Hub
  15. uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
  16. with:
  17. username: ${{ secrets.DOCKER_USERNAME }}
  18. password: ${{ secrets.DOCKER_PASSWORD }}
  19. - name: Extract metadata (tags, labels) for Docker
  20. id: meta
  21. uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
  22. with:
  23. images: hoppscotch/hoppscotch
  24. flavor: |
  25. latest=true
  26. prefix=
  27. suffix=
  28. - name: Build and push Docker image
  29. uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
  30. with:
  31. context: .
  32. push: true
  33. tags: ${{ steps.meta.outputs.tags }}
  34. labels: ${{ steps.meta.outputs.labels }}