feat: 添加读卡器测试功能,支持设备连接、状态读取和卡片操作 #15
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 and Deploy to GitHub Pages | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| # 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, skipping runs queued between the run in-progress and latest queued. | |
| # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| cache: 'npm' | |
| - name: Verify package files | |
| run: | | |
| echo "package.json content:" | |
| cat package.json | |
| echo "package-lock.json exists:" | |
| ls -la package-lock.json | |
| - name: Install dependencies | |
| run: | | |
| # Use npm ci for faster, reliable, reproducible builds | |
| # Fall back to npm install if package-lock.json is out of sync | |
| npm ci || npm install | |
| - name: Build project | |
| run: npm run build | |
| - name: Prepare deployment files | |
| run: | | |
| # Copy all files from public to dist | |
| cp -r public/* dist/ | |
| # List files to verify | |
| echo "Files in dist directory:" | |
| ls -la dist/ | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v4 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./dist | |
| # Deployment job | |
| 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 |