Skip to content

Created CI/CD Pipeline #10

Created CI/CD Pipeline

Created CI/CD Pipeline #10

Workflow file for this run

name: CI/CD Pipeline
on:
push:
branches: main
pull_request:
branches: main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pages: write
id-token: write
jobs:
backend-tests:
name: Python Backend Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v5
with:
python-version: '3.11'
cache: 'pip'
- run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
pip install pytest responses
- run: pytest tests/
env:
GIT_TOKEN: "dummy_token_for_testing"
frontend-checks:
name: React Lint & Test
runs-on: ubuntu-latest
needs: backend-tests
defaults:
run:
working-directory: Frontend
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run lint
- run: npm run test -- --run
build:
name: Build React App
runs-on: ubuntu-latest
needs: frontend-checks
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm run build --base=/oss_dev_analytics/
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: './dist'
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
needs: build
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4