Openweather app submission (#488) #554
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy App Viewer to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v6 | |
| with: | |
| path: main | |
| - name: Checkout app-viewer source | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: app-viewer-source | |
| path: app-viewer-source | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| - name: Install dependencies | |
| run: | | |
| cd app-viewer-source/app-viewer | |
| npm install | |
| - name: Build site into staging directory | |
| run: | | |
| mkdir -p _site | |
| # Copy app-viewer static assets to site root | |
| cp app-viewer-source/app-viewer/index.html _site/ | |
| cp app-viewer-source/app-viewer/app.html _site/ | |
| cp app-viewer-source/app-viewer/main.js _site/ | |
| cp app-viewer-source/app-viewer/style.css _site/ | |
| cp app-viewer-source/app-viewer/dots.svg _site/ | |
| cp app-viewer-source/app-viewer/dots@2x.svg _site/ | |
| # Generate apps.json directly into the site root (using apps from main branch) | |
| node app-viewer-source/app-viewer/generate-apps-json.js --output _site/apps.json --apps-path main/apps | |
| # Copy the apps directory (images and other assets referenced by the viewer) | |
| cp -r main/apps _site/apps | |
| # Copy broken_apps.txt if present | |
| [ -f main/broken_apps.txt ] && cp main/broken_apps.txt _site/ || true | |
| # Disable Jekyll | |
| touch _site/.nojekyll | |
| - name: Deploy to gh-pages branch | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./_site | |
| publish_branch: gh-pages | |
| force_orphan: true |