feat(#59): add weekly training planner view #179
Workflow file for this run
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: Azure Static Web Apps CI/CD | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| paths: | |
| - 'app/**' | |
| - '.github/workflows/**' | |
| pull_request: | |
| types: [opened, synchronize, reopened, closed] | |
| branches: | |
| - master | |
| - dev | |
| paths: | |
| - 'app/**' | |
| - '.github/workflows/**' | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| jobs: | |
| build_and_deploy_job: | |
| if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.action != 'closed') | |
| runs-on: ubuntu-latest | |
| name: Test, Build and Deploy | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| lfs: false | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| cache-dependency-path: app/package-lock.json | |
| - name: Install dependencies | |
| working-directory: app | |
| run: npm ci | |
| - name: Lint and audit | |
| working-directory: app | |
| run: | | |
| npm run lint & | |
| LINT_PID=$! | |
| npm audit --audit-level=high & | |
| AUDIT_PID=$! | |
| wait $LINT_PID | |
| LINT_EXIT=$? | |
| wait $AUDIT_PID | |
| AUDIT_EXIT=$? | |
| if [ $LINT_EXIT -ne 0 ] || [ $AUDIT_EXIT -ne 0 ]; then exit 1; fi | |
| - name: Test with coverage | |
| working-directory: app | |
| run: npm run test:ci | |
| - name: Restore Vite build cache | |
| uses: actions/cache@v4 | |
| with: | |
| path: app/node_modules/.vite | |
| key: vite-${{ runner.os }}-${{ hashFiles('app/src/**', 'app/vite.config.js') }} | |
| restore-keys: vite-${{ runner.os }}- | |
| - name: Build app | |
| working-directory: app | |
| run: npm run build | |
| env: | |
| VITE_SUPABASE_URL: ${{ secrets.VITE_SUPABASE_URL }} | |
| VITE_SUPABASE_ANON_KEY: ${{ secrets.VITE_SUPABASE_ANON_KEY }} | |
| - name: Build And Deploy | |
| id: builddeploy | |
| uses: Azure/static-web-apps-deploy@v1 | |
| with: | |
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WHITE_ISLAND_090DFD003 }} | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| action: "upload" | |
| app_location: "app/dist" | |
| api_location: "app/api" | |
| output_location: "." | |
| close_pull_request_job: | |
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
| runs-on: ubuntu-latest | |
| name: Close Pull Request Job | |
| steps: | |
| - name: Close Pull Request | |
| id: closepullrequest | |
| uses: Azure/static-web-apps-deploy@v1 | |
| with: | |
| azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN_WHITE_ISLAND_090DFD003 }} | |
| action: "close" |