Add PDF open link and mobile fallback in PDFViewer: Introduced a butt… #133
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: | |
| # Trigger on push to main branch | |
| push: | |
| branches: [ main ] | |
| # Allow manual trigger | |
| workflow_dispatch: | |
| # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow only one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Generate build info | |
| run: | | |
| BUILD_DATE=$(date -u +%Y-%m-%d) | |
| BUILD_TIME=$(date -u +%H:%M:%S) | |
| BUILD_TIMESTAMP=$(date -u +%s) | |
| echo "Generating build-info.json with timestamp: $BUILD_DATE at $BUILD_TIME UTC" | |
| echo "{\"buildDate\":\"$BUILD_DATE\",\"buildTime\":\"$BUILD_TIME\",\"timestamp\":$BUILD_TIMESTAMP}" > build-info.json | |
| cat build-info.json | |
| ls -la build-info.json | |
| - name: Build with Astro | |
| env: | |
| PUBLIC_ANALYTICS_API: ${{ secrets.PUBLIC_ANALYTICS_API || 'https://analytics-api-one.vercel.app/api' }} | |
| run: npm run build | |
| - name: Verify build info in dist | |
| run: | | |
| if [ -f dist/_astro/build-info.*.json ] || grep -r "buildDate" dist/ 2>/dev/null; then | |
| echo "Build info found in dist" | |
| else | |
| echo "Warning: Build info may not be bundled correctly" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./dist | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |