Sentiment Pipeline #347
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: Sentiment Pipeline | |
| on: | |
| schedule: | |
| - cron: "0 */12 * * *" # every 12 hours utc | |
| workflow_dispatch: # ์๋ ์คํ ๋ฒํผ | |
| jobs: | |
| run-sentiment: | |
| runs-on: ubuntu-latest | |
| steps: | |
| # 1. ์ ์ฅ์ ์ฒดํฌ์์ | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| # 2. Python ์ค์น | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.11" | |
| # 3. pip ์บ์ | |
| - name: Cache pip | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-v2-${{ hashFiles('piplist.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| # 4. ๋ชจ๋ธ ์บ์ (SaveModel ๋๋ ํ ๋ฆฌ) | |
| - name: Cache model files | |
| uses: actions/cache@v3 | |
| with: | |
| path: SaveModel/ | |
| key: ${{ runner.os }}-sentiment-model-v4 # ๋ชจ๋ธ v4 | |
| restore-keys: | | |
| ${{ runner.os }}-sentiment-model- | |
| # 5. ์์กด์ฑ ์ค์น | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r piplist.txt | |
| # 6. ํ๊ฒฝ ๋ณ์ ์ธํ | |
| - name: Set environment variables | |
| run: | | |
| echo "SUPABASE_URL=$SUPABASE_URL" >> $GITHUB_ENV | |
| echo "SUPABASE_KEY=$SUPABASE_KEY" >> $GITHUB_ENV | |
| env: | |
| SUPABASE_URL: ${{ secrets.SUPABASE_URL }} | |
| SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }} | |
| # 7. ์คํฌ๋ฆฝํธ ์คํ (main.py ์์์ ํ์์ ๋ชจ๋ธ ๋ค์ด๋ก๋) | |
| - name: Run sentiment script | |
| run: python main.py |