publish-workflow.yaml 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. name: Publish Docker image
  2. on:
  3. push:
  4. tags:
  5. - '**'
  6. jobs:
  7. publish:
  8. runs-on: ubuntu-latest
  9. steps:
  10. - name: Checkout repository
  11. uses: actions/checkout@v4
  12. - name: Set up QEMU
  13. uses: docker/setup-qemu-action@v3
  14. - name: Set up Docker Buildx
  15. uses: docker/setup-buildx-action@v3
  16. - name: Get metadata for Docker
  17. id: metadata
  18. uses: docker/metadata-action@v5
  19. with:
  20. images: |
  21. hlohaus789/g4f
  22. ghcr.io/${{ github.repository }}
  23. - name: Log in to Docker Hub
  24. uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
  25. with:
  26. username: ${{ secrets.DOCKER_USERNAME }}
  27. password: ${{ secrets.DOCKER_PASSWORD }}
  28. - name: Login to GitHub Container Registry
  29. uses: docker/login-action@v3
  30. with:
  31. registry: ghcr.io
  32. username: ${{ github.repository_owner }}
  33. password: ${{ secrets.GHCR_PAT }}
  34. - name: Build and push small images
  35. uses: docker/build-push-action@v5
  36. with:
  37. context: .
  38. file: docker/Dockerfile-slim
  39. platforms: linux/amd64,linux/arm64
  40. push: true
  41. tags: |
  42. hlohaus789/g4f:latest-slim
  43. hlohaus789/g4f:${{ github.ref_name }}-slim
  44. labels: ${{ steps.metadata.outputs.labels }}
  45. build-args: |
  46. G4F_VERSION=${{ github.ref_name }}
  47. - name: Build and push big images
  48. uses: docker/build-push-action@v5
  49. with:
  50. context: .
  51. file: docker/Dockerfile
  52. platforms: linux/amd64,linux/arm64
  53. push: true
  54. tags: ${{ steps.metadata.outputs.tags }}
  55. labels: ${{ steps.metadata.outputs.labels }}
  56. build-args: |
  57. G4F_VERSION=${{ github.ref_name }}