Skip to content

deploy update

deploy update #125

Workflow file for this run

name: Deploy on EC2
on:
push:
branches: [master]
workflow_dispatch:
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install Requirements
run: |
pip install --upgrade pip
pip install -r dev-requirements.txt
pip install -r requirements.txt
- name: Run Flake8
run: flake8 --max-line-length 119 ./src
- name: Prepare TestBed
run: |
sudo apt-get update -y
sudo apt-get install -y libopus-dev
- name: Test Run Boi
run: |
python src/main.py &
sleep 20
kill "$!"
env:
BOT_TOKEN: ${{ secrets.TEST_BOI_DC_TOKEN }}
SERVER_IP: ${{ secrets.SERVER_IP }}
SERVER_PORT: ${{ secrets.SERVER_PORT }}
SERVER_ENDPOINT: ${{ secrets.SERVER_ENDPOINT }}
WAVELINK_URL: ${{ secrets.WAVELINK_URL }}
WAVELINK_PORT: ${{ secrets.WAVELINK_PORT }}
WAVELINK_PASSWORD: ${{ secrets.WAVELINK_PASSWORD }}
docker_build:
name: Build and push docker container
needs: tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v3
with:
context: .
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/wkk-offcial/boi_redemption_arc:latest,ghcr.io/wkk-offcial/boi_redemption_arc:${{ github.sha }}
trigger_deploy:
name: Trigger deployment pipeline
runs-on: ubuntu-latest
needs: docker_build
steps:
- name: Trigger deployment pipeline
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.DEPLOY_API_TOKEN }}
repository: wkk-offcial/bot_deployment
event-type: trigger-event