publish-workflow.yaml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 image
  35. uses: docker/build-push-action@v5
  36. with:
  37. context: .
  38. file: docker/Dockerfile
  39. platforms: linux/amd64,linux/arm64
  40. push: true
  41. tags: ${{ steps.metadata.outputs.tags }}
  42. labels: ${{ steps.metadata.outputs.labels }}
  43. build-args: |
  44. G4F_VERSION=${{ github.ref_name }}