Scrape 1 #157
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: Scrape 1 | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 12 * * 5' # 金曜日の21時に起動 | |
jobs: | |
backend: | |
name: ruby | |
runs-on: ubuntu-latest | |
services: | |
selenium: | |
image: selenium/standalone-chrome:3.141.59-vanadium | |
ports: | |
- 4444:4444 | |
volumes: | |
- /dev/shm:/dev/shm | |
env: | |
SELENIUM_HOST: "localhost:4444" | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '2.6' | |
- name: bundle install | |
run: | | |
gem install bundler:2.1.4 | |
bundle install | |
working-directory: ${{ github.workspace }}/backend | |
- name: run ruby | |
run: ruby scrape.rb | |
working-directory: ${{ github.workspace }}/backend | |
- name: copy file | |
run: cp halo.json ../frontend/utils | |
working-directory: ${{ github.workspace }}/backend | |
- name: git setting | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- name: Commit files | |
run: | | |
git add -A | |
if ! git diff-index --quiet HEAD --; then git commit -a -m "Update json (By GitHub Actions)"; fi; | |
git push | |
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." |