Create deploy-staging.yml #36
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: CI/CD Pipeline | |
on: | |
push: | |
pull_request: | |
jobs: | |
python-tests: | |
name: Python Unit Testing | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.x' | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Run Python Unit Tests | |
run: pytest --junitxml=pytest-results.xml | |
nodejs-tests: | |
name: Node.js Unit Testing | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
- name: Install Node.js dependencies | |
run: npm install | |
- name: Run Node.js Unit Tests | |
run: npm test | |
deploy: | |
name: Deploy to Staging | |
needs: [python-tests, nodejs-tests] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Run Deployment Commands | |
run: | | |
echo "Starting deployment..." | |
# Add other deployment commands here | |
echo "Deployment successful!" |