Skip to content

Favorites Updater

Favorites Updater #89

Workflow file for this run

name: Favorites Updater
on:
workflow_dispatch:
# デバッグ用に手動実行を許可
schedule:
- cron: "0 15 * * SAT"
- cron: "0 3 * * WED"
# 毎週日の午前0時・水の午後0時に起動(JST, UTC+9)
env:
LANG: "ja_JP.UTF-8"
jobs:
Updater:
runs-on: ubuntu-latest
env:
BOOKMETER_ACCOUNT: ${{ secrets.BOOKMETER_ACCOUNT }}
BOOKMETER_PASSWORD: ${{ secrets.BOOKMETER_PASSWORD }}
CINII_API_APPID: ${{ secrets.CINII_API_APPID }}
BOUNDHUB_ACCOUNT: ${{ secrets.BOUNDHUB_ACCOUNT }}
BOUNDHUB_PASSWORD: ${{ secrets.BOUNDHUB_PASSWORD }}
NOTE_ACCOUNT: ${{ secrets.NOTE_ACCOUNT }}
NOTE_PASSWORD: ${{ secrets.NOTE_PASSWORD }}
TERATAIL_API_TOKEN: ${{ secrets.TERATAIL_API_TOKEN }}
ZENN_GOOGLE_ACCOUNT: ${{ secrets.ZENN_GOOGLE_ACCOUNT }}
ZENN_GOOGLE_PASSWORD: ${{ secrets.ZENN_GOOGLE_PASSWORD }}
TWITTER_ACCOUNT: ${{ secrets.TWITTER_ACCOUNT }}
TWITTER_PASSWORD: ${{ secrets.TWITTER_PASSWORD }}
WIKIPEDIA_USERNAME: ${{ secrets.WIKIPEDIA_USERNAME }}
WIKIPEDIA_PASSWORD: ${{ secrets.WIKIPEDIA_PASSWORD }}
OAUTH_TOKEN_OF_GITHUB: ${{ secrets.OAUTH_TOKEN_OF_GITHUB }}
NICONICO_ACCOUNT: ${{ secrets.NICONICO_ACCOUNT }}
NICONICO_PASSWORD: ${{ secrets.NICONICO_PASSWORD }}
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
FIREBASE_AUTH_DOMAIN: ${{ secrets.FIREBASE_AUTH_DOMAIN }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_STORAGE_BUCKET: ${{ secrets.FIREBASE_STORAGE_BUCKET }}
FIREBASE_MESSAGING_SENDER_ID: ${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}
FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }}
GOOGLE_BOOKS_API_KEY: ${{ secrets.GOOGLE_BOOKS_API_KEY }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
- name: Install dependencies
run: npm install
- name: Install Japanese fonts, xvfb, and q command
run: sudo apt-get update && sudo apt-get install -y fonts-noto xvfb python3-q-text-as-data
# 文字化けを防ぐ生活の知恵
# https://qiita.com/zyyx-matsushita/items/c33f79e33f242395019e
- name: Create dotenv file
shell: bash
run: touch .env |
echo "BOOKMETER_ACCOUNT=${{ secrets.BOOKMETER_ACCOUNT }}" >> .env
echo "BOOKMETER_PASSWORD=${{ secrets.BOOKMETER_PASSWORD }}" >> .env
echo "CINII_API_APPID=${{ secrets.CINII_API_APPID }}" >> .env
echo "BOUNDHUB_ACCOUNT=${{ secrets.BOUNDHUB_ACCOUNT }}" >> .env
echo "BOUNDHUB_PASSWORD=${{ secrets.BOUNDHUB_PASSWORD }}" >> .env
echo "NOTE_ACCOUNT=${{ secrets.NOTE_ACCOUNT }}" >> .env
echo "NOTE_PASSWORD=${{ secrets.NOTE_PASSWORD }}" >> .env
echo "TERATAIL_API_TOKEN=${{ secrets.TERATAIL_API_TOKEN }}" >> .env
echo "ZENN_GOOGLE_ACCOUNT=${{ secrets.ZENN_GOOGLE_ACCOUNT }}" >> .env
echo "ZENN_GOOGLE_PASSWORD=${{ secrets.ZENN_GOOGLE_PASSWORD }}" >> .env
echo "TWITTER_ACCOUNT=${{ secrets.TWITTER_ACCOUNT }}" >> .env
echo "TWITTER_PASSWORD=${{ secrets.TWITTER_PASSWORD }}" >> .env
echo "WIKIPEDIA_USERNAME=${{ secrets.WIKIPEDIA_USERNAME }}" >> .env
echo "WIKIPEDIA_PASSWORD=${{ secrets.WIKIPEDIA_PASSWORD }}" >> .env
echo "OAUTH_TOKEN_OF_GITHUB=${{ secrets.OAUTH_TOKEN_OF_GITHUB }}" >> .env
echo "NICONICO_ACCOUNT=${{ secrets.NICONICO_ACCOUNT }}" >> .env
echo "NICONICO_PASSWORD=${{ secrets.NICONICO_PASSWORD }}" >> .env
- name: Bookmeter Wish
shell: bash
working-directory: ./bookmeter_wish
run: npx tsx ./puppeteer_bookmeter.ts && bash ./is_in_my_lib.sh
- name: GitHub Stars
shell: bash
working-directory: ./github_stars
run: npx tsx ./index.ts
- name: Qiita LGTM
shell: bash
working-directory: ./qiita_lgtm
run: npx tsx ./puppeteer_qiita.ts
- name: BoundHub Faved Movies
shell: bash
working-directory: ./boundhub
run: npx tsx ./puppeteer_boundhub.ts && bash ./get_url_list.sh
- name: note Faved Articles
shell: bash
env:
LANG: "ja_JP.UTF-8"
working-directory: ./note_favs
run: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' npx tsx ./puppeteer_note.ts
# - name: Zenn Faved Articles
# shell: bash
# working-directory: ./zenn_favs
# run: xvfb-run --auto-servernum --server-args='-screen 0, 1600x900x24' node ./puppeteer_zenn.js
# headless: falseで動かすための生活の知恵
# https://github.com/peterdanis/electron-puppeteer-demo/issues/171
- name: Wikipedia Watchlist
shell: bash
working-directory: ./wikipedia_watchlist
run: npx tsx ./index.ts
# - name: Niconico Seiga MyClips
# shell: bash
# working-directory: ./nicoseiga
# run: npx tsx ./puppeteer_nicoseiga.ts && bash ./get_url_list.sh
- name: Togetter Favorites
shell: bash
working-directory: ./togetter
run: npx tsx ./puppeteer_togetter.ts
- name: Set the current datetime
env:
TZ: "Asia/Tokyo"
run: echo "CURRENT_DATETIME=$(date --iso-8601=minutes)" >> $GITHUB_ENV
- name: Git Auto Commit
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "auto-updated: ${{ env.CURRENT_DATETIME }}"
# branch: master