Scrape action #948
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: Scrape action | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 15 * * *' # 毎日日本時間の0時に更新 | |
jobs: | |
scrape: | |
name: ruby | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: bundle install | |
run: | | |
gem install bundler:2.1.4 | |
bundle install | |
working-directory: ${{ github.workspace }}/Scraper | |
- name: run ruby | |
run: ruby scrape.rb | |
working-directory: ${{ github.workspace }}/Scraper | |
- name: copy file | |
run: cp result.json ../Viewer/resource | |
working-directory: ${{ github.workspace }}/Scraper | |
- 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." |