remove legacy roles from current #79
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 | |
| with: | |
| persist-credentials: false | |
| - 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 | |
| # More explicit data copying steps | |
| - name: Prepare team data | |
| run: | | |
| # Ensure directories exist | |
| mkdir -p public/data/team | |
| # Copy all team assets from src to public | |
| 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 | |
| # Copy 404.html to dist if it exists in public | |
| - 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 | |
| # Ensure team data is in dist | |
| - name: Copy team data to dist | |
| run: | | |
| mkdir -p dist/data/team | |
| cp -rv public/data/team/* dist/data/team/ || echo "No team data to copy" | |
| # Verify the build output | |
| - name: Verify build artifacts | |
| run: | | |
| echo "Contents of dist/data/team:" | |
| ls -la dist/data/team/ || echo "dist/data/team directory not found!" | |
| # Check specific files | |
| 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 | |
| commit_message: "Deploy from GitHub Actions" |