.github/workflows/update.yml #146
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
on: | |
schedule: | |
- cron: '0 9 * * *' | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@master | |
- name: cache node_modules | |
id: node_modules_cache_id | |
uses: actions/cache@v3 | |
with: | |
path: | | |
node_modules | |
key: node-v${{ matrix.node-version }}-deps-${{ hashFiles('./yarn.lock') }} | |
- name: Yarn Install | |
run: | | |
yarn install | |
- name: Update sites | |
run: | | |
yarn run do | |
- name: Commit files | |
run: | | |
git add -N . # 新規ファイルを含める | |
if ! git diff --exit-code --quiet | |
then | |
git config --local user.email "[email protected]" | |
git config --local user.name "su-u" | |
git add . | |
git commit -m "Update: github actions" | |
git push | |
fi |