Skip to content

Commit

Permalink
Create fairy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HKLHaoBin authored Oct 5, 2024
1 parent 21a9610 commit 7a37a1f
Showing 1 changed file with 69 additions and 0 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Discord + Qianfan Bot CI/CD

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install appbuilder-sdk qianfan nest_asyncio discord.py redis
- name: Set environment variables
env:
QIANFAN_ACCESS_KEY: ${{ secrets.QIANFAN_ACCESS_KEY }}
QIANFAN_SECRET_KEY: ${{ secrets.QIANFAN_SECRET_KEY }}
APPBUILDER_TOKEN: ${{ secrets.APPBUILDER_TOKEN }}
Review_app_id: ${{ secrets.REVIEW_APP_ID }}
Chat_app_id: ${{ secrets.CHAT_APP_ID }}
run: echo "Environment variables set."

- name: Run Lint
run: |
pip install flake8
flake8 .
- name: Run Tests
run: |
# Add test command here if applicable, e.g., pytest
echo "No tests available."
- name: Run Discord Bot (Check Build)
env:
QIANFAN_ACCESS_KEY: ${{ secrets.QIANFAN_ACCESS_KEY }}
QIANFAN_SECRET_KEY: ${{ secrets.QIANFAN_SECRET_KEY }}
APPBUILDER_TOKEN: ${{ secrets.APPBUILDER_TOKEN }}
Review_app_id: ${{ secrets.REVIEW_APP_ID }}
Chat_app_id: ${{ secrets.CHAT_APP_ID }}
run: |
python main.py
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Deploy to Production
run: |
echo "Deploying..."
# Add your deployment script here

0 comments on commit 7a37a1f

Please sign in to comment.