Update vercel-api submodule: exclude localhost from traffic sources #14
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
| # Builds an Astro site and deploys it to GitHub Pages | |
| name: Build and Deploy (Astro → GitHub Pages) | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Generate build info | |
| run: | | |
| BUILD_DATE=$(date -u +'%Y-%m-%d') | |
| BUILD_TIME=$(date -u +'%H:%M:%S') | |
| TIMESTAMP=$(date -u +%s) | |
| GIT_SHA=$(git rev-parse --short HEAD) | |
| GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
| NODE_VERSION=$(node --version) | |
| ASTRO_VERSION=$(node -e "const pkg = require('./package.json'); console.log(pkg.dependencies.astro.replace('^', ''))" || echo "unknown") | |
| THREE_VERSION=$(node -e "const pkg = require('./package.json'); console.log(pkg.dependencies.three.replace('^', ''))" || echo "unknown") | |
| MERMAID_VERSION=$(node -e "const pkg = require('./package.json'); console.log(pkg.dependencies.mermaid.replace('^', ''))" || echo "unknown") | |
| PDFJS_VERSION=$(node -e "const pkg = require('./package.json'); console.log(pkg.dependencies['pdfjs-dist'].replace('^', ''))" || echo "unknown") | |
| MARKED_VERSION=$(node -e "const pkg = require('./package.json'); console.log(pkg.dependencies.marked.replace('^', ''))" || echo "unknown") | |
| echo "Versions: Node=$NODE_VERSION, Astro=$ASTRO_VERSION, Three=$THREE_VERSION, Mermaid=$MERMAID_VERSION, PDFjs=$PDFJS_VERSION, Marked=$MARKED_VERSION" | |
| cat <<EOF > build-info.json | |
| { | |
| "buildDate": "$BUILD_DATE", | |
| "buildTime": "$BUILD_TIME", | |
| "timestamp": $TIMESTAMP, | |
| "deployment": $GITHUB_RUN_NUMBER, | |
| "gitSha": "$GIT_SHA", | |
| "gitBranch": "$GIT_BRANCH", | |
| "nodeVersion": "$NODE_VERSION", | |
| "astroVersion": "$ASTRO_VERSION", | |
| "threeVersion": "$THREE_VERSION", | |
| "mermaidVersion": "$MERMAID_VERSION", | |
| "pdfjsVersion": "$PDFJS_VERSION", | |
| "markedVersion": "$MARKED_VERSION" | |
| } | |
| EOF | |
| - name: Sync build/version json into public | |
| run: | | |
| cp build-info.json public/build-info.json | |
| cp version.json public/version.json | |
| - name: Build site | |
| run: npm run build | |
| # Use the updated upload-pages-artifact action (v3) which uses supported upload-artifact@v4 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pages: write | |
| id-token: write | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |