スクリプトを実行する #294
This file contains 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: スクリプトを実行する | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 22 * * *' | |
jobs: | |
run_script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: リポジトリをチェックアウト | |
uses: actions/checkout@v4 | |
- name: 前回の成果物をダウンロード | |
uses: dawidd6/action-download-artifact@v6 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
name: artifact | |
path: tmp | |
if_no_artifact_found: ignore | |
- name: Pythonの実行環境をセットアップ | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: 依存関係のインストール | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: リポジトリ内のPythonファイルを実行 | |
env: | |
BLUESKY_HANDLE: ${{ secrets.BLUESKY_HANDLE }} | |
BLUESKY_PASSWORD: ${{ secrets.BLUESKY_PASSWORD }} | |
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
run: python main.py "${BLUESKY_HANDLE}" "${BLUESKY_PASSWORD}" "${GEMINI_API_KEY}" | |
- name: 成果物をアップロード | |
uses: actions/upload-artifact@v4 | |
with: | |
name: artifact | |
path: tmp/ | |
retention-days: 10 |