build_toolchain.yml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. name: 'Build toolchain Docker image'
  2. on:
  3. push:
  4. branches:
  5. - dev
  6. tags:
  7. - '*'
  8. jobs:
  9. build:
  10. runs-on: ubuntu-latest
  11. steps:
  12. - name: Checkout code
  13. uses: actions/checkout@v2
  14. with:
  15. fetch-depth: 0
  16. - name: Docker meta
  17. id: meta
  18. uses: docker/metadata-action@v3
  19. with:
  20. images: flipperdevices/flipperzero-toolchain
  21. flavor: latest=${{ startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref, 'rc')}}
  22. tags: |
  23. type=ref,event=branch
  24. type=ref,event=tag
  25. - name: Set up QEMU
  26. uses: docker/setup-qemu-action@v1
  27. - name: Set up Docker Buildx
  28. uses: docker/setup-buildx-action@v1
  29. - name: Login to DockerHub
  30. uses: docker/login-action@v1
  31. with:
  32. username: ${{ secrets.DOCKERHUB_USERNAME }}
  33. password: ${{ secrets.DOCKERHUB_TOKEN }}
  34. - name: Build and push
  35. id: docker_build
  36. uses: docker/build-push-action@v2
  37. with:
  38. context: docker/
  39. push: true
  40. tags: ${{ steps.meta.outputs.tags }}
  41. labels: ${{ steps.meta.outputs.labels }}
  42. platforms: linux/amd64,linux/arm64
  43. cache-from: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache
  44. cache-to: type=registry,ref=flipperdevices/flipperzero-toolchain:buildcache,mode=max