typo fix #43
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: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out the code | |
| uses: actions/checkout@v3 | |
| # persist-credentials defaults to true, so we can drop the override. | |
| - name: Use Node | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: 18 | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Create .env file | |
| run: | | |
| echo "VITE_SUPABASE_URL=${{ secrets.VITE_SUPABASE_URL }}" > .env | |
| echo "VITE_SUPABASE_ANON_KEY=${{ secrets.VITE_SUPABASE_ANON_KEY }}" >> .env | |
| - name: Prepare team data | |
| run: | | |
| mkdir -p public/data/team | |
| if [ -d "src/data/team" ]; then | |
| cp -rv src/data/team/* public/data/team/ | |
| echo "Copied team data from src to public" | |
| ls -la public/data/team/ | |
| fi | |
| - name: Build | |
| run: npm run build | |
| - name: Create .nojekyll file | |
| run: touch dist/.nojekyll | |
| - name: Copy 404.html | |
| run: | | |
| if [ -f "public/404.html" ]; then | |
| cp public/404.html dist/404.html | |
| echo "✅ 404.html copied to dist" | |
| else | |
| echo "❌ 404.html not found in public directory" | |
| fi | |
| - name: Copy all data files to dist | |
| run: | | |
| echo "Copying all public/data to dist/data..." | |
| mkdir -p dist/data | |
| cp -rv public/data/* dist/data/ || echo "No data to copy" | |
| echo "Contents of dist/data:" | |
| find dist/data -type f | head -20 | |
| echo "Video files in dist/data/media/videos:" | |
| ls -la dist/data/media/videos/ || echo "No video files found" | |
| echo "Thumbnail files in dist/data/media:" | |
| ls -la dist/data/media/*-thumb.jpg || echo "No thumbnail files found" | |
| - name: Verify build artifacts | |
| run: | | |
| echo "Verifying team data:" | |
| ls -la dist/data/team/ || echo "dist/data/team directory not found!" | |
| echo "Verifying video files:" | |
| if [ -d "dist/data/media/videos" ]; then | |
| echo "✅ Videos directory exists" | |
| ls -la dist/data/media/videos/ | |
| else | |
| echo "❌ Videos directory missing" | |
| fi | |
| echo "Verifying thumbnail files:" | |
| if ls dist/data/media/*-thumb.jpg 1> /dev/null 2>&1; then | |
| echo "✅ Thumbnail files exist:" | |
| ls -la dist/data/media/*-thumb.jpg | |
| else | |
| echo "❌ Thumbnail files missing" | |
| fi | |
| if [ -f "dist/data/team/06.md" ]; then | |
| echo "✅ 06.md exists in build output" | |
| else | |
| echo "❌ 06.md missing from build output" | |
| fi | |
| if [ -f "dist/data/team/06.png" ]; then | |
| echo "✅ 06.png exists in build output" | |
| else | |
| echo "❌ 06.png missing from build output" | |
| fi | |
| - name: Deploy to gh-pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./dist | |
| publish_branch: gh-pages | |
| force_orphan: true | |
| cname: dreamlab-ai.com | |
| commit_message: "Deploy from GitHub Actions ${{ github.sha }}" |