docker-image-arm64.yml 1.5 KB

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