docker-image-amd64.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. name: Publish Docker image (amd64)
  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: Log in to Docker Hub
  26. uses: docker/login-action@v2
  27. with:
  28. username: ${{ secrets.DOCKERHUB_USERNAME }}
  29. password: ${{ secrets.DOCKERHUB_TOKEN }}
  30. - name: Log in to the Container registry
  31. uses: docker/login-action@v2
  32. with:
  33. registry: ghcr.io
  34. username: ${{ github.actor }}
  35. password: ${{ secrets.GITHUB_TOKEN }}
  36. - name: Extract metadata (tags, labels) for Docker
  37. id: meta
  38. uses: docker/metadata-action@v4
  39. with:
  40. images: |
  41. calciumion/new-api
  42. ghcr.io/${{ github.repository }}
  43. - name: Build and push Docker images
  44. uses: docker/build-push-action@v3
  45. with:
  46. context: .
  47. push: true
  48. tags: ${{ steps.meta.outputs.tags }}
  49. labels: ${{ steps.meta.outputs.labels }}