manual-update-webinstaller.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # This updates the Web Installer with the files from the docs folder and the binary of the latest release
  2. # it only gets run on:
  3. # - Manually triggered
  4. # Make sure to also update the lower part of build.yml!
  5. name: Manual Web Installer Update
  6. on:
  7. workflow_dispatch: # Run on manual trigger
  8. # push:
  9. # branches:
  10. # - rolling
  11. # paths:
  12. # - docs # The path filter somehow does not work, so lets run it on every change to rolling
  13. jobs:
  14. manually-update-web-installer:
  15. environment:
  16. name: github-pages
  17. url: ${{ steps.deployment.outputs.page_url }}
  18. runs-on: ubuntu-latest
  19. # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
  20. permissions:
  21. contents: read
  22. pages: write
  23. id-token: write
  24. steps:
  25. - name: Checkout
  26. uses: actions/checkout@v3
  27. - name: Get version of last release
  28. id: last_release
  29. uses: mindojo/get-latest-release@0b8ef1434d7468d6bffcc8263baff5c777f72321
  30. with:
  31. myToken: ${{ github.token }}
  32. exclude_types: "draft|prerelease"
  33. view_top: 1
  34. - name: Add binary to Web Installer and update manifest
  35. run: |
  36. echo "Updating Web installer to use firmware from ${{ steps.last_release.outputs.tag_name }}..."
  37. rm -f docs/binary/firmware.bin
  38. wget https://github.com/jomjol/AI-on-the-edge-device/releases/download/${{ steps.last_release.outputs.tag_name }}/AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
  39. unzip AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
  40. cp -f firmware.bin docs/binary/firmware.bin
  41. echo "Updating index and manifest file..."
  42. sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/index.html
  43. sed -i 's/$VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/manifest.json
  44. - name: Setup Pages
  45. uses: actions/configure-pages@v2
  46. - name: Upload artifact
  47. uses: actions/upload-pages-artifact@v1
  48. with:
  49. path: 'docs'
  50. - name: Deploy to GitHub Pages
  51. id: deployment
  52. uses: actions/deploy-pages@v1