Daily Activity Script Run #99
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Daily Activity Script Run | |
| env: | |
| DIFY_BASE_URL: ${{ secrets.DIFY_BASE_URL }} | |
| DATASET_ID: ${{ secrets.ACTIVITY_DATASET_ID }} | |
| DOCUMENT_ID: ${{ secrets.ACTIVITY_DOCUMENTS_ID }} | |
| KB_API_KEY: ${{ secrets.KB_API_KEY }} | |
| on: | |
| schedule: | |
| - cron: '0 16 * * *' # Runs daily at midnight UTC | |
| workflow_dispatch: | |
| jobs: | |
| run-daily-activity: | |
| name: Run Daily Activity Script | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| pip install -r crawler/requirements.txt | |
| - name: Run daily activity script | |
| run: python -m script.activity.crawler_activity | |
| - name: Update activity_KB | |
| run: python -m script.activity.update_activity_kb | |
| - name: Upload activity_result.json to remote server | |
| run: | | |
| curl -v -X POST "${{secrets.UPDATE_ACT_INFO_URL}}?file_type=json" \ | |
| -F "file=@crawler/save/activity/activity_result.json" | |
| - name: Update act_info | |
| run: | | |
| curl -X POST ${{secrets.DIFY_BASE_URL}}/workflows/run \ | |
| --header 'Authorization: Bearer ${{secrets.UPDATE_ACT_INFO_API_KEY}}' \ | |
| --header 'Content-Type: application/json' \ | |
| --data-raw '{ | |
| "inputs": {}, | |
| "response_mode": "blocking", | |
| "user": "github" | |
| }' |