build #53118
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: build | |
on: | |
push: | |
branches: | |
- 'master' | |
workflow_dispatch: | |
schedule: | |
- cron: '*/10 * * * *' | |
# 10分ごとに実行 | |
jobs: | |
ubuntu: | |
runs-on: ubuntu-latest | |
env: | |
GOOGLE_SHEET_API_KEY: ${{ secrets.GOOGLE_SHEET_API_KEY }} | |
GOOGLE_SHEET_URL: ${{ secrets.GOOGLE_SHEET_URL }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 16.x | |
- run: npm install | |
- name: Download data and set up environment variables | |
run: | | |
node bin/download.js ${GOOGLE_SHEET_URL} ${GOOGLE_SHEET_API_KEY} | |
node bin/config.js | |
- name: Build PWA Assets | |
run: | | |
npm run build:assets | |
- name: Push the data to Github | |
run: | | |
git config --global user.name "${GITHUB_ACTOR}" | |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
if (git diff --shortstat | grep '[0-9]'); then \ | |
git add .; \ | |
git status .; \ | |
git commit -m "スプレッドシートのデータを更新"; \ | |
git push -f origin master; \ | |
fi | |
- run: npm run build | |
- name: Deploy | |
uses: JamesIves/github-pages-deploy-action@4.1.1 | |
with: | |
branch: 'gh-pages' | |
folder: './build/' | |
target-folder: './' |