feat(auth): Enhance login page and AuthContext integration with JWT h… #1
This file contains 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: CI/CD Pipeline | |
on: | |
pull_request: | |
branches: | |
- develop | |
push: | |
branches: | |
- develop | |
jobs: | |
checkout-code: | |
name: Checkout Code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
lint-backend: | |
name: Lint Backend | |
runs-on: ubuntu-latest | |
needs: checkout-code | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set Up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Make gradlew Executable | |
run: | | |
cd backend | |
chmod +x gradlew | |
- name: Lint Backend Code | |
run: | | |
cd backend | |
./gradlew check | |
test-backend: | |
name: Test Backend | |
runs-on: ubuntu-latest | |
needs: lint-backend | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set Up JDK | |
uses: actions/setup-java@v3 | |
with: | |
java-version: 17 | |
distribution: temurin | |
- name: Make gradlew Executable | |
run: | | |
cd backend | |
chmod +x gradlew | |
- name: Run Backend Tests | |
run: | | |
cd backend | |
./gradlew test | |
lint-frontend: | |
name: Lint Frontend | |
runs-on: ubuntu-latest | |
needs: checkout-code | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set Up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.18.0 | |
- name: Lint Frontend Code | |
run: | | |
cd frontend | |
npm install | |
npm run lint | |
test-frontend: | |
name: Test Frontend | |
runs-on: ubuntu-latest | |
needs: lint-frontend | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set Up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.18.0 | |
- name: Install Dependencies and Run Tests | |
run: | | |
cd frontend | |
npm install | |
npm test | |
ui-ux-tests: | |
name: UI/UX Tests | |
runs-on: ubuntu-latest | |
needs: [test-backend, test-frontend] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set Up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.18.0 | |
- name: Install Dependencies | |
run: | | |
cd frontend | |
npm install | |
- name: Start Frontend Server | |
run: | | |
cd frontend | |
npm run dev & | |
env: | |
PORT: 3000 | |
- name: Wait for Frontend Server | |
run: | | |
npx wait-on http://localhost:3000 | |
- name: Run Cypress Tests | |
run: | | |
cd frontend | |
npx cypress run | |
deploy-staging: | |
name: Deploy to Staging | |
runs-on: ubuntu-latest | |
needs: [ui-ux-tests] | |
if: success() | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Deploy to Staging Server | |
run: | | |
echo "Deploying to Staging Environment..." | |
# Add deployment commands here |