Skip to content

@.各ファイルの役割

Geusen edited this page Jul 11, 2022 · 13 revisions

ディレクトリ

Schedule_Bot
├─ client_secrets.json  (GoogleDriveアクセス用)
├─ credentials.json  (〃)
├─ schedule.py  (プログラムが記述してある)
├─ settings.py  (環境変数関連)
├─ settings.yaml  (GoogleDriveアクセス用)
│ 
└─ .github
    └─ workflows
        └─ Schedule.yml  (定期実行用ファイル)

※client_secrets.jsonとcredentials.jsonはschedule.pyで一時的に作成されるファイル

Schedule.yml

name: GitHub_Actions(shedule) on: workflow_dispatch: schedule: - cron: "*/10 0-12,21-23 * * *" #6時〜21時、10分ごとに動作 env: #環境変数から文字列(パスワードなど)を取得 ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}} ACCESS_TOKEN_SECRET: ${{secrets.ACCESS_TOKEN_SECRET}} CONSUMER_KEY: ${{secrets.CONSUMER_KEY}} CONSUMER_SECRET: ${{secrets.CONSUMER_SECRET}} GOOGLE_URL: ${{secrets.GOOGLE_URL}} LINE_NOTIFY: ${{secrets.LINE_NOTIFY}} LINE_NOTIFY_27: ${{secrets.LINE_NOTIFY_27}} DISCORD_TOKEN: ${{secrets.DISCORD_TOKEN}} DISCORD_ID: ${{secrets.DISCORD_ID}} DISCORD_ID_DEBUG: ${{secrets.DISCORD_ID_DEBUG}} JSON: ${{secrets.JSON}} CLIENT: ${{secrets.CLIENT}}

jobs: python: runs-on: ubuntu-latest timeout-minutes: 5 steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 with: python-version: '3.6.15' architecture: 'x64' - run: | python -m pip install --upgrade pip pip install get-chrome-driver --upgrade pip install python-dotenv==0.19.2 pip install selenium==3.141.0 pip install tweepy==4.6.0 pip install discord.py==1.7.3 pip install pillow==8.4.0 pip install pydrive==1.3.1 pip install opencv-python==4.5.5.64 python schedule.py - name: Keepalive Workflow uses: gautamkrishnar/keepalive-workflow@1.0.7

Clone this wiki locally