chore(repo): untrack 03-Client/node_modules and ignore all node_modules #1
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
| # --------------------------------------------------------------------------- | |
| # CD Pipeline — deploy backend + frontend to Azure on push to main | |
| # --------------------------------------------------------------------------- | |
| # Phase 7.5/7.6: Triggered after CI passes on main branch. | |
| # | |
| # Jobs: | |
| # 1. backend — publish .NET 8 app → Azure App Service (zip deploy) | |
| # 2. frontend — build Vite app → Azure Static Web Apps | |
| # | |
| # Required GitHub Secrets: | |
| # - AZURE_WEBAPP_PUBLISH_PROFILE (App Service publish profile XML) | |
| # - AZURE_STATIC_WEB_APPS_API_TOKEN (SWA deployment token) | |
| # --------------------------------------------------------------------------- | |
| name: CD | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: | |
| group: cd-${{ github.ref }} | |
| cancel-in-progress: false # Don't cancel in-flight deploys | |
| jobs: | |
| backend: | |
| name: Deploy Backend | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: 02-Server | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: "8.0.x" | |
| - name: Restore | |
| run: dotnet restore | |
| - name: Publish | |
| run: dotnet publish -c Release -o ./publish --no-restore | |
| - name: Deploy to Azure App Service | |
| uses: azure/webapps-deploy@v3 | |
| with: | |
| app-name: app-groundshare-api | |
| publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }} | |
| package: 02-Server/publish | |
| - name: Health check | |
| run: | | |
| sleep 30 | |
| for i in 1 2 3 4 5; do | |
| STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://app-groundshare-api.azurewebsites.net/api/health || true) | |
| if [ "$STATUS" = "200" ]; then | |
| echo "Health check passed" | |
| exit 0 | |
| fi | |
| echo "Attempt $i: status $STATUS, retrying in 15s..." | |
| sleep 15 | |
| done | |
| echo "Health check failed after 5 attempts" | |
| exit 1 | |
| frontend: | |
| name: Deploy Frontend | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| cache-dependency-path: 03-Client/package-lock.json | |
| - name: Install dependencies | |
| working-directory: 03-Client | |
| run: npm ci | |
| - name: Build | |
| working-directory: 03-Client | |
| run: npm run build | |
| env: | |
| VITE_API_BASE_URL: https://app-groundshare-api.azurewebsites.net/api | |
| - name: Deploy to Azure Static Web Apps | |
| uses: Azure/static-web-apps-deploy@v1 | |
| with: | |
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| action: upload | |
| app_location: 03-Client/dist | |
| skip_app_build: true | |
| skip_api_build: true |