Skip to content

Commit

Permalink
fix: separate workflow to four part (#141)
Browse files Browse the repository at this point in the history
* fix: separate workflow to four part

* chore: rename job name
  • Loading branch information
andyhuang18 authored Dec 5, 2024
1 parent 9f024d0 commit a046607
Show file tree
Hide file tree
Showing 9 changed files with 1,550 additions and 983 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Monthly company data Script Execution
name: Monthly company data Script Execution 1

on:
schedule:
Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Run the Python script
run: |
cd dashboard/company/scripts
python workflow.py
python workflow_1.py
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USER: ${{ secrets.DB_USER }}
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/updateCompanyData_2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Monthly company data Script Execution 2

on:
schedule:
# 每个月2号的00:00 UTC运行脚本
- cron: '0 0 2 * *'
workflow_dispatch: # 也允许手动触发工作流

jobs:
run_python_script:
runs-on: ubuntu-latest # 使用 GitHub 提供的 Ubuntu 环境

steps:
- name: Checkout code
uses: actions/checkout@v3 # 检出仓库代码

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # 设置 Python 版本

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start ClickHouse service
run: |
docker run -d --name clickhouse-server --ulimit nofile=262144:262144 -p 9000:9000 clickhouse/clickhouse-server
sleep 30
- name: List running containers
run: docker ps -a

- name: Check ClickHouse logs
run: docker logs clickhouse-server

- name: Test ClickHouse query
run: |
docker exec -i clickhouse-server clickhouse-client --query "SELECT 1"
- name: Run the Python script
run: |
cd dashboard/company/scripts
python workflow_2.py
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DASHBOARDS_DB_HOST: ${{ secrets.DASHBOARD_DB_HOST }}
DASHBOARDS_DB_USER: ${{ secrets.DASHBOARD_DB_USER }}
DASHBOARDS_DB_PASSWORD: ${{ secrets.DASHBOARD_DB_PASSWORD }}
52 changes: 52 additions & 0 deletions .github/workflows/updateCompanyData_3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Monthly company data Script Execution 3

on:
schedule:
# 每个月2号的00:00 UTC运行脚本
- cron: '0 0 2 * *'
workflow_dispatch: # 也允许手动触发工作流

jobs:
run_python_script:
runs-on: ubuntu-latest # 使用 GitHub 提供的 Ubuntu 环境

steps:
- name: Checkout code
uses: actions/checkout@v3 # 检出仓库代码

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # 设置 Python 版本

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start ClickHouse service
run: |
docker run -d --name clickhouse-server --ulimit nofile=262144:262144 -p 9000:9000 clickhouse/clickhouse-server
sleep 30
- name: List running containers
run: docker ps -a

- name: Check ClickHouse logs
run: docker logs clickhouse-server

- name: Test ClickHouse query
run: |
docker exec -i clickhouse-server clickhouse-client --query "SELECT 1"
- name: Run the Python script
run: |
cd dashboard/company/scripts
python workflow_3.py
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DASHBOARDS_DB_HOST: ${{ secrets.DASHBOARD_DB_HOST }}
DASHBOARDS_DB_USER: ${{ secrets.DASHBOARD_DB_USER }}
DASHBOARDS_DB_PASSWORD: ${{ secrets.DASHBOARD_DB_PASSWORD }}
52 changes: 52 additions & 0 deletions .github/workflows/updateCompanyData_4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Monthly company data Script Execution 4

on:
schedule:
# 每个月2号的00:00 UTC运行脚本
- cron: '0 0 2 * *'
workflow_dispatch: # 也允许手动触发工作流

jobs:
run_python_script:
runs-on: ubuntu-latest # 使用 GitHub 提供的 Ubuntu 环境

steps:
- name: Checkout code
uses: actions/checkout@v3 # 检出仓库代码

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # 设置 Python 版本

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Start ClickHouse service
run: |
docker run -d --name clickhouse-server --ulimit nofile=262144:262144 -p 9000:9000 clickhouse/clickhouse-server
sleep 30
- name: List running containers
run: docker ps -a

- name: Check ClickHouse logs
run: docker logs clickhouse-server

- name: Test ClickHouse query
run: |
docker exec -i clickhouse-server clickhouse-client --query "SELECT 1"
- name: Run the Python script
run: |
cd dashboard/company/scripts
python workflow_4.py
env:
DB_HOST: ${{ secrets.DB_HOST }}
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DASHBOARDS_DB_HOST: ${{ secrets.DASHBOARD_DB_HOST }}
DASHBOARDS_DB_USER: ${{ secrets.DASHBOARD_DB_USER }}
DASHBOARDS_DB_PASSWORD: ${{ secrets.DASHBOARD_DB_PASSWORD }}
Loading

0 comments on commit a046607

Please sign in to comment.