remove: gitkeep削除 #74
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
name: Deploy to GitHub Pages | |
on: | |
push: | |
branches: | |
- main | |
# paths: | |
# - 'docs/**' | |
permissions: | |
actions: write | |
checks: write | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Cache node modules | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-node-modules | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
- if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} | |
name: npm install | |
run: npm ci | |
- name: Install dependencies and build | |
run: | | |
npm run rebuild | |
env: | |
GITHUB_PAGES: true | |
- name: Deploy to GitHub Pages | |
run: | | |
git add -N . # 新規ファイルを含める | |
if ! git diff --exit-code --quiet | |
then | |
git config user.name "${{ vars.GIT_USER_NAME }}" | |
git config user.email "${{ vars.GIT_USER_EMAIL }}" | |
git add . | |
git commit -m "Update GitHub Pages" | |
git push | |
fi |