Skip to content

Update CI/CD workflow for website deployment #41

Update CI/CD workflow for website deployment

Update CI/CD workflow for website deployment #41

Workflow file for this run

name: Continuous Integration and Deployment
on:
push:
branches:
- main
- website
- feature/website-software-hardware-integration
pull_request:
branches:
- main
- website
- feature/website-software-hardware-integration
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run tests
run: |
python -m unittest discover -s tests
deploy-website:
needs: build
if: github.ref == 'refs/heads/website' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Install website dependencies
run: |
cd website
npm ci
- name: Build website
run: |
cd website
npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./website/build