ci.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. name: ci
  2. on:
  3. push:
  4. branches:
  5. - 'master'
  6. tags:
  7. - "*"
  8. jobs:
  9. docker:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout
  13. uses: actions/checkout@v4
  14. - name: Set up QEMU
  15. uses: docker/setup-qemu-action@v3
  16. - name: Set up Docker Buildx
  17. uses: docker/setup-buildx-action@v3
  18. - name: Login to DockerHub
  19. uses: docker/login-action@v3
  20. with:
  21. username: ${{ secrets.DOCKERHUB_USERNAME }}
  22. password: ${{ secrets.DOCKERHUB_TOKEN }}
  23. - name: Extract metadata (tags, labels) for Docker
  24. id: meta
  25. uses: docker/metadata-action@v5
  26. with:
  27. images: ${{ secrets.DOCKERHUB_USERNAME }}/zoffline
  28. tags: |
  29. type=ref,event=tag
  30. type=raw,value=latest,enable={{is_default_branch}}
  31. - name: Build and push
  32. uses: docker/build-push-action@v5
  33. with:
  34. context: .
  35. labels: ${{ steps.meta.outputs.labels }}
  36. platforms: linux/amd64,linux/arm64
  37. push: true
  38. tags: ${{ steps.meta.outputs.tags }}