fix #88: 文本输入模式生成的条码现将自动写入剪贴板 #13
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: | |
| - master | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout qr-code-buddy repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: Mq-b/qr-code-buddy | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Configure base path for GitHub Pages | |
| run: | | |
| sed -i "/export default defineConfig(({ mode }) => ({/a \ \ base: '/Lab2QRCode/'," vite.config.ts | |
| echo "=== vite.config.ts after modification ===" | |
| cat vite.config.ts | |
| - name: Configure React Router basename | |
| run: | | |
| # 给 BrowserRouter 添加 basename 属性 | |
| sed -i 's/<BrowserRouter>/<BrowserRouter basename="\/Lab2QRCode\/">/' src/App.tsx | |
| echo "=== App.tsx after modification ===" | |
| grep -A 3 -B 3 "BrowserRouter" src/App.tsx | |
| - name: Build static site | |
| run: npm run build | |
| - name: Configure for GitHub Pages SPA | |
| run: | | |
| touch dist/.nojekyll | |
| cp dist/index.html dist/404.html | |
| echo "✅ Created . nojekyll and 404.html for SPA support" | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./dist | |
| deploy: | |
| name: 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 |