docker-image-arm64.yml 1.5 KB

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