manual-update-webinstaller.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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. # - Changes to the docs folder in the `rolling` branch
  4. # - On a release
  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. rm -f docs/binary/firmware.bin
  37. 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
  38. unzip AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
  39. cp -f firmware.bin docs/binary/firmware.bin
  40. cp -f docs/manifest_template.json docs/manifest.json
  41. sed -i 's/VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/manifest.json
  42. - name: Setup Pages
  43. uses: actions/configure-pages@v2
  44. - name: Upload artifact
  45. uses: actions/upload-pages-artifact@v1
  46. with:
  47. path: 'docs'
  48. - name: Deploy to GitHub Pages
  49. id: deployment
  50. uses: actions/deploy-pages@v1