Skip to content

Merge pull request #83 from scamper07/feature/refactor #43

Merge pull request #83 from scamper07/feature/refactor

Merge pull request #83 from scamper07/feature/refactor #43

Workflow file for this run

# This workflow will build, test and deploy to development and production environments
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
permissions:
contents: read
jobs:
DeployToDev:
name: Deploy to development
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
environment: development
strategy:
matrix:
python-version: ['3.9', '3.10']
steps:
- name: Checkout repo
uses: actions/checkout@main
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Set up virtual environment
run: make setup-venv
- name: Set up Python packages
run: make setup
- name: Run linter
run: make lint
- name: Run Tests
run: make test
- name: Deploy
run: echo Bot deployed!
DeployToProd:
name: Deploy to production
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: self-hosted
environment: production
steps:
- name: Deploy
run: echo Deploying to Production environment
- uses: actions/checkout@v3
- name: Rebuild and start container
run: |
docker-compose up -d --build --force-recreate bro
env:
DISCORD_BOT_TOKEN: ${{secrets.DISCORD_BOT_TOKEN}}