Skip to content

generateLogPage

generateLogPage #924

# This is a basic workflow to help you get started with Actions
name: generateLogPage
# Controls when the workflow will run
on:
#ログのプッシュをトリガーとする mergeもpush扱い
push:
paths:
- "ログ/**"
schedule:
# 定期実行 世界標準時刻で19時のとき日本は4時なんですよ…!
# pushによるトリガーが何かしらの理由で失敗した時用
- cron: '0 19 * * *'
# 手動実行・皇
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
#fork先では機能しないように
if: github.repository == 'orga-itsuka-trpg/TRPG-OCL-Rule'
# The type of runner that the job will run on
runs-on: ubuntu-20.04
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# minify前ログリストを作業用フォルダに生成
- name: Run a python script
run: |
mkdir ./work
python3 .github/workflows/generator.py > ./work/logViewer.html
# Job for Minify
- name: HTML/CSS/JS Minifier
uses: docker://devatherock/minify-js:1.0.3
with:
directory: './work' # Optional
output: '.' # Optional
add_suffix: false # Optional
# 作業用フォルダをクリーン
- name: rename logViewer
run: |
rm ./work/logViewer.html
cat logViewer.html
#Diffをとって失敗時(=変更無しのとき)でも成功にする
- name: Diff
id: diff
run: |
git add -N .
git diff --name-only --exit-code
continue-on-error: true
# 成果物をプッシュ
- name: Commit & Push
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "generated"
git push
if: steps.diff.outcome == 'failure'