docker-image-arm64.yml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Publish Docker image (Multi Registries)
  2. on:
  3. push:
  4. tags:
  5. - '*'
  6. jobs:
  7. push_to_registries:
  8. name: Push Docker image to multiple registries
  9. runs-on: ubuntu-latest
  10. permissions:
  11. packages: write
  12. contents: read
  13. steps:
  14. - name: Check out the repo
  15. uses: actions/checkout@v4
  16. - name: Save version info
  17. run: |
  18. git describe --tags > VERSION
  19. - name: Set up QEMU
  20. uses: docker/setup-qemu-action@v3
  21. - name: Set up Docker Buildx
  22. uses: docker/setup-buildx-action@v3
  23. - name: Log in to Docker Hub
  24. uses: docker/login-action@v3
  25. with:
  26. username: ${{ secrets.DOCKERHUB_USERNAME }}
  27. password: ${{ secrets.DOCKERHUB_TOKEN }}
  28. - name: Log in to the Container registry
  29. uses: docker/login-action@v3
  30. with:
  31. registry: ghcr.io
  32. username: ${{ github.actor }}
  33. password: ${{ secrets.GITHUB_TOKEN }}
  34. - name: Extract metadata (tags, labels) for Docker
  35. id: meta
  36. uses: docker/metadata-action@v5
  37. with:
  38. images: |
  39. calciumion/new-api
  40. ghcr.io/${{ github.repository }}
  41. - name: Build and push Docker images
  42. uses: docker/build-push-action@v5
  43. with:
  44. context: .
  45. platforms: linux/amd64,linux/arm64
  46. push: true
  47. tags: ${{ steps.meta.outputs.tags }}
  48. labels: ${{ steps.meta.outputs.labels }}