feed-to-json and deploy #8032
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
# This is a workflow to create json from blog & slide data and deploy with Actions | |
name: feed-to-json and deploy | |
env: | |
TZ: Asia/Tokyo | |
on: | |
schedule: | |
- cron: '00 */3 * * *' | |
workflow_dispatch: | |
jobs: | |
update_data: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
path: production | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: pip install feedparser | |
- name: Run python script (feedreader.py) | |
run: python3 -B production/tools/feedreader.py > production/docs/feed.json | |
- name: Create Pull Request main | |
uses: peter-evans/create-pull-request@v6 | |
id: cpr | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
path: production | |
commit-message: BOT; UPDATE DATA | |
title: BOT; UPDATE DATA to main | |
base: main | |
branch: data-bot/main | |
labels: auto_merge | |
- name: Merge Pull Request | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: gh pr merge ${{ steps.cpr.outputs.pull-request-url }} --merge |