Ignore local photo upload folder #24
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 to blog | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: main | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18.20.8' | |
| cache: npm | |
| - name: Install dependencies | |
| env: | |
| NPM_CONFIG_REGISTRY: https://registry.npmjs.org/ | |
| run: | | |
| set -euo pipefail | |
| node -v | |
| npm -v | |
| npm ci --include=dev --no-audit --no-fund | |
| test -f node_modules/vite/package.json | |
| - name: Build | |
| env: | |
| NODE_ENV: development | |
| run: npm run build | |
| - name: Add 404 fallback | |
| run: cp dist/index.html dist/404.html | |
| - name: Publish dist to blog | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_branch: blog | |
| publish_dir: ./dist | |
| force_orphan: true |