Skip to content

generate-and-commit-files-by-crontab #661

generate-and-commit-files-by-crontab

generate-and-commit-files-by-crontab #661

Workflow file for this run

name: generate-and-commit-files-by-crontab
on:
schedule:
- cron: '0 0 * * */2'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v1
- name: Change language
run: |
sudo apt-get install language-pack-ja
sudo update-locale LANG=ja_JP.UTF-8
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install deps
run: |
npm ci
- name: Build
run: |
npm run build
# - name: Update last updated
# run: |
# sed -i "s/\(last auto-updated time: \).*$/\1$(stat --format="%x" output/result.jpg)/g" ./README.md
- name: Commit to repository
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COMMIT_MSG: |
update result.jpg and readme
run: |
git config user.email "no-reply@hiroppy.me"
git config user.name "hiroppy-bot"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
git checkout master
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin master)