v0.4.4: Fix folder drop, translucent loading overlay, UI improvements #78
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: Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [main] | |
| tags: ['v[0-9]+.[0-9]+.[0-9]+*'] # Semver tags only | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| concurrency: | |
| # Separate queues for main (dev) and tags (releases) to prevent cancellation | |
| # when pushing both at the same time | |
| group: pages-deploy-${{ github.ref_type }} | |
| cancel-in-progress: false # Queue, don't cancel (prevents corruption) | |
| env: | |
| NODE_VERSION: '22' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Determine deployment target | |
| id: target | |
| run: | | |
| if [[ "${{ github.ref_type }}" == "tag" ]]; then | |
| TAG="${GITHUB_REF_NAME}" | |
| echo "is_release=true" >> $GITHUB_OUTPUT | |
| echo "version=$TAG" >> $GITHUB_OUTPUT | |
| echo "base_path=/$TAG/" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_release=false" >> $GITHUB_OUTPUT | |
| echo "version=dev" >> $GITHUB_OUTPUT | |
| echo "base_path=/dev/" >> $GITHUB_OUTPUT | |
| fi | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: 'npm' | |
| - run: npm ci | |
| # Build for version/dev directory | |
| - name: Build | |
| run: npm run build | |
| env: | |
| VITE_BASE: ${{ steps.target.outputs.base_path }} | |
| # Deploy to version directory (v0.3.2 or dev) | |
| - name: Deploy to version directory | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| destination_dir: ${{ steps.target.outputs.version }} | |
| keep_files: true | |
| commit_message: "Deploy ${{ steps.target.outputs.version }}" | |
| # For releases: also update /latest/ | |
| - name: Rebuild for latest | |
| if: steps.target.outputs.is_release == 'true' | |
| run: npm run build | |
| env: | |
| VITE_BASE: /latest/ | |
| - name: Deploy to latest | |
| if: steps.target.outputs.is_release == 'true' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| destination_dir: latest | |
| keep_files: true | |
| commit_message: "Update latest to ${{ steps.target.outputs.version }}" | |
| # Update root redirect (only on release) | |
| - name: Create root redirect | |
| if: steps.target.outputs.is_release == 'true' | |
| run: | | |
| mkdir -p root | |
| cat > root/index.html << 'EOF' | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="refresh" content="0; url=/latest/"> | |
| <link rel="canonical" href="/latest/"> | |
| <title>ColmapView</title> | |
| </head> | |
| <body> | |
| <p>Redirecting to <a href="/latest/">latest version</a>...</p> | |
| </body> | |
| </html> | |
| EOF | |
| touch root/.nojekyll | |
| - name: Deploy root | |
| if: steps.target.outputs.is_release == 'true' | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./root | |
| keep_files: true | |
| commit_message: "Update root redirect" |