CaCO3 3 лет назад
Родитель
Сommit
d4b2bec45f
1 измененных файлов с 44 добавлено и 2 удалено
  1. 44 2
      .github/workflows/build.yaml

+ 44 - 2
.github/workflows/build.yaml

@@ -363,5 +363,47 @@ jobs:
 #########################################################################################
 ## Update the Web Installer on a release
 #########################################################################################
-  update-webinstaller:
-    uses: ./.github/workflows/update-webinstaller.yml
+# This is the same as in the update-webinstaller.yml
+  update-web-installer:    
+    environment:
+      name: github-pages
+      url: ${{ steps.deployment.outputs.page_url }}
+    runs-on: ubuntu-latest
+
+    # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
+    permissions:
+      contents: read
+      pages: write
+      id-token: write
+
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v3
+      
+    - name: Get version of last release
+      id: last_release
+      uses: InsonusK/get-latest-release@v1.0.1
+      with:
+        myToken: ${{ github.token }}
+        exclude_types: "release"
+        view_top: 1     
+      
+    - name: Add binary to Web Installer and update manifest
+      run: |
+        rm -f docs/binary/firmware.bin
+        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
+        unzip AI-on-the-edge-device__update__${{ steps.last_release.outputs.tag_name }}.zip
+        cp -f firmware.bin docs/binary/firmware.bin
+        cp -f docs/manifest_template.json docs/manifest.json
+        sed -i 's/VERSION/${{ steps.last_release.outputs.tag_name }}/g' docs/manifest.json
+    - name: Setup Pages
+      uses: actions/configure-pages@v2
+
+    - name: Upload artifact
+      uses: actions/upload-pages-artifact@v1
+      with:
+        path: 'docs'
+
+    - name: Deploy to GitHub Pages
+      id: deployment
+      uses: actions/deploy-pages@v1