main.yml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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: Get python
  36. uses: actions/setup-python@v2
  37. with:
  38. python-version: '3.7'
  39. -
  40. name: Lint with flake8
  41. run: |
  42. pip install flake8
  43. flake8 . --max-line-length=130
  44. -
  45. name: Run Buildx
  46. run: |
  47. docker buildx build --push \
  48. --tag hvalev/dht22mqtt-homeassistant:latest \
  49. --tag hvalev/dht22mqtt-homeassistant:${BUILD_VERSION} \
  50. --tag ghcr.io/hvalev/dht22mqtt-homeassistant-docker:latest
  51. --tag ghcr.io/hvalev/dht22mqtt-homeassistant-docker:${BUILD_VERSION}
  52. --platform linux/arm/v7,linux/arm64 .
  53. -
  54. name: Docker Hub Description
  55. uses: peter-evans/dockerhub-description@v2
  56. env:
  57. DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUBUNAME }}
  58. DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUBPWD }}
  59. DOCKERHUB_REPOSITORY: hvalev/dht22mqtt