html-to-image and deploy #7973
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 image data from html and deploy with Actions | |
name: html-to-image and deploy | |
env: | |
TZ: Asia/Tokyo | |
on: | |
schedule: | |
- cron: '05 */3 * * *' | |
workflow_dispatch: | |
jobs: | |
create_data: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: main | |
path: production | |
- run: cp production/puppeteer-app/package.json /home/runner/work/create-readme/create-readme/package.json | |
- run: cp production/puppeteer-app/package-lock.json /home/runner/work/create-readme/create-readme/package-lock.json | |
- name: Install font | |
run: sudo apt-get install fonts-noto | |
- name: Setup nodejs | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.x | |
cache: npm | |
- name: Install dependencies | |
run: npm install | |
- name: Run js script (app.js) | |
run: node production/puppeteer-app/app.js | |
- 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 IMAGE | |
title: BOT; UPDATE IMAGE 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 |