docker.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. name: Publish Docker image
  2. on:
  3. workflow_dispatch:
  4. release:
  5. types: [published]
  6. jobs:
  7. push_to_registry:
  8. name: Push Docker image to Docker Hub
  9. runs-on: ubuntu-latest
  10. steps:
  11. -
  12. name: Check out the repo
  13. uses: actions/checkout@v3
  14. -
  15. name: Log in to Docker Hub
  16. uses: docker/login-action@v2
  17. with:
  18. username: ${{ secrets.DOCKER_USERNAME }}
  19. password: ${{ secrets.DOCKER_PASSWORD }}
  20. -
  21. name: Extract metadata (tags, labels) for Docker
  22. id: meta
  23. uses: docker/metadata-action@v4
  24. with:
  25. images: yidadaa/chatgpt-next-web
  26. tags: |
  27. type=raw,value=latest
  28. type=ref,event=tag
  29. -
  30. name: Set up QEMU
  31. uses: docker/setup-qemu-action@v2
  32. -
  33. name: Set up Docker Buildx
  34. uses: docker/setup-buildx-action@v2
  35. -
  36. name: Build and push Docker image
  37. uses: docker/build-push-action@v4
  38. with:
  39. context: .
  40. platforms: linux/amd64,linux/arm64
  41. push: true
  42. tags: ${{ steps.meta.outputs.tags }}
  43. labels: ${{ steps.meta.outputs.labels }}
  44. cache-from: type=gha
  45. cache-to: type=gha,mode=max