Skip to content

generate-gpt-column #508

generate-gpt-column

generate-gpt-column #508

name: generate-gpt-column
on:
schedule:
- cron: '0 3 * * *'
workflow_dispatch:
env:
AWS_REGION : "ap-northeast-1"
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.MZ_SITE_ROLE_ARN }}
role-session-name: image-push-session
aws-region: ${{ env.AWS_REGION }}
- name: Set up Node.js environment
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: scripts/package-lock.json
- name: Install
run: cd ${GITHUB_WORKSPACE}/scripts && npm ci
- name: Update page for GPT generated column
id: update-for-gpt-column
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
SLACK_CHANNEL_ID: ${{ vars.MAIN_SLACK_CHANNEL_ID }}
run: |
set -eu
cd ${GITHUB_WORKSPACE}/scripts
npm run generate:column
git add ${GITHUB_WORKSPACE}/src/_data
- name: Commit and Create Pull request
uses: peter-evans/create-pull-request@v6
with:
commit-message: "chore: Add GPT generated column"
author: "mameka <[email protected]>"
branch: daily-mameka-column
delete-branch: true
title: "[auto-review] Update GPT column by github-actions"
body: "Check the GPT generated column."
reviewers: kudoh
labels: bot