docker.yml 977 B

1234567891011121314151617181920212223242526272829303132333435
  1. name: Publish Docker Image
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. version:
  6. description: 'new image tag(e.g. v1.1.0)'
  7. required: true
  8. default: 'latest'
  9. concurrency:
  10. group: ${{ github.workflow }}-${{ github.ref }}
  11. cancel-in-progress: true
  12. jobs:
  13. docker:
  14. runs-on: ubuntu-latest
  15. steps:
  16. - name: Checkout repository
  17. uses: actions/checkout@v3
  18. - name: Set up QEMU
  19. uses: docker/setup-qemu-action@v2
  20. - name: Set up Docker Buildx
  21. uses: docker/setup-buildx-action@v2
  22. - name: Login to DockerHub
  23. uses: docker/login-action@v2
  24. with:
  25. username: ${{ secrets.DOCKERHUB_USERNAME }}
  26. password: ${{ secrets.DOCKERHUB_TOKEN }}
  27. - name: Build and push
  28. uses: docker/build-push-action@v3
  29. with:
  30. platforms: linux/amd64,linux/arm64
  31. push: true
  32. tags: ${{vars.DOCKERHUB_REPO}}:${{ github.event.inputs.version }}