Merge pull request #76 from AET-DevOps25/deploy-to-aws #145
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: Client Code Quality & Testing | |
| on: | |
| push: | |
| branches: ["**"] | |
| paths: | |
| - "client/**" | |
| pull_request: | |
| branches: ["**"] | |
| paths: | |
| - "client/**" | |
| jobs: | |
| client-check-format: | |
| name: Code Quality Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies (Client) | |
| working-directory: ./client | |
| run: npm ci | |
| - name: Run ESLint on changed files | |
| continue-on-error: true | |
| working-directory: ./client | |
| run: | | |
| changed_files=$(git diff --name-only --diff-filter=ACMRT HEAD^ HEAD | grep -E '\.(js|jsx|ts|tsx)$' | sed 's|^client/||' || true) | |
| if [ -n "$changed_files" ]; then | |
| echo "Running ESLint on changed files:" | |
| echo "$changed_files" | |
| npx eslint $changed_files | |
| else | |
| echo "No JavaScript/TypeScript files changed" | |
| fi | |
| - name: Check TypeScript compilation | |
| working-directory: ./client | |
| run: npx tsc --noEmit | |
| client-run-tests: | |
| name: Run Tests | |
| runs-on: ubuntu-latest | |
| needs: client-check-format | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install dependencies | |
| working-directory: ./client | |
| run: npm ci | |
| - name: Run tests | |
| working-directory: ./client | |
| run: npm test | |
| - name: Run build test | |
| working-directory: ./client | |
| run: npm run build | |
| deployment-notice: | |
| name: Deployment Information | |
| runs-on: ubuntu-latest | |
| needs: [client-check-format, client-run-tests] | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/main') | |
| steps: | |
| - name: Show deployment info | |
| run: | | |
| echo "ℹ️ **Client Deployment Information**" | |
| echo "" | |
| if [ "${{ github.event_name }}" = "pull_request" ]; then | |
| echo "🔄 **Pull Request detected**" | |
| echo "- Client will be deployed to **pre-prod** environment" | |
| echo "- Deployment handled by unified server-ci-cd.yml pipeline" | |
| echo "- URL: https://cache-me-if-you-can-client-pre-prod.team-cache-me-if-you-can.student.k8s.aet.cit.tum.de" | |
| elif [ "${{ github.ref }}" = "refs/heads/main" ]; then | |
| echo "🚀 **Main branch push detected**" | |
| echo "- Client will be deployed to **prod** environment" | |
| echo "- Deployment handled by unified server-ci-cd.yml pipeline" | |
| echo "- URL: https://cache-me-if-you-can-client-prod.team-cache-me-if-you-can.student.k8s.aet.cit.tum.de" | |
| fi |