publish-workflow.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: Get metadata for Docker
  13. id: metadata
  14. uses: docker/metadata-action@v5
  15. with:
  16. images: |
  17. hlohaus789/g4f
  18. ghcr.io/${{ github.repository }}
  19. - name: Log in to Docker Hub
  20. uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
  21. with:
  22. username: ${{ secrets.DOCKER_USERNAME }}
  23. password: ${{ secrets.DOCKER_PASSWORD }}
  24. - name: Login to GitHub Container Registry
  25. uses: docker/login-action@v3
  26. with:
  27. registry: ghcr.io
  28. username: ${{ github.repository_owner }}
  29. password: ${{ secrets.GHCR_PAT }}
  30. - name: Build and push image
  31. uses: docker/build-push-action@v5
  32. with:
  33. context: .
  34. file: docker/Dockerfile
  35. push: true
  36. tags: ${{ steps.metadata.outputs.tags }}
  37. labels: ${{ steps.metadata.outputs.labels }}
  38. build-args: |
  39. G4F_VERSION=${{ github.ref_name }}