-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (45 loc) · 1.48 KB
/
image-creator.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# 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