main.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: build
  2. on:
  3. push:
  4. tags:
  5. - 'v*'
  6. paths-ignore:
  7. - 'README.md'
  8. - datasets/**
  9. env:
  10. BUILD_VERSION: "0.1.0"
  11. jobs:
  12. buildx:
  13. runs-on: ubuntu-latest
  14. steps:
  15. -
  16. name: Checkout
  17. uses: actions/checkout@v2
  18. -
  19. name: Set up QEMU
  20. uses: docker/setup-qemu-action@v1
  21. -
  22. name: Set up Docker Buildx
  23. id: buildx
  24. uses: docker/setup-buildx-action@v1
  25. -
  26. name: Available platforms
  27. run: echo ${{ steps.buildx.outputs.platforms }}
  28. -
  29. name: Login to DockerHub
  30. uses: docker/login-action@v1
  31. with:
  32. username: ${{ secrets.DOCKERHUBUNAME }}
  33. password: ${{ secrets.DOCKERHUBTOKEN }}
  34. -
  35. name: Lint with flake8
  36. run: |
  37. pip install flake8
  38. flake8 . --max-line-length=130
  39. -
  40. name: Run Buildx
  41. run: |
  42. docker buildx build --push \
  43. --tag hvalev/dht22mqtt-homeassistant:latest \
  44. --tag hvalev/dht22mqtt-homeassistant:${BUILD_VERSION} \
  45. --tag ghcr.io/hvalev/dht22mqtt-homeassistant-docker:latest
  46. --tag ghcr.io/hvalev/dht22mqtt-homeassistant-docker:${BUILD_VERSION}
  47. --platform linux/arm/v7,linux/arm64 .
  48. -
  49. name: Docker Hub Description
  50. uses: peter-evans/dockerhub-description@v2
  51. env:
  52. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUBUNAME }}
  53. DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUBPWD }}
  54. DOCKERHUB_REPOSITORY: hvalev/dht22mqtt