1
0
Fork 0
mirror of https://github.com/kou029w/megabit.git synced 2025-01-30 21:58:04 +00:00

use actions/setup-node@v2, actions/checkout@v2

This commit is contained in:
Nebel 2021-07-25 00:08:56 +09:00
parent 9024ec8237
commit 215649f60a
2 changed files with 26 additions and 25 deletions

View file

@ -1,25 +0,0 @@
name: github-pages
on:
push:
branches: [master]
jobs:
main:
runs-on: ubuntu-latest
env:
EMAIL: octocat@github.com
steps:
- uses: actions/checkout@v1
- run: echo "::set-env name=YARN_CACHE_DIR::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ env.YARN_CACHE_DIR }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: yarn-
- run: yarn
- run: git -c user.name="$(whoami)" subtree add --prefix docs origin gh-pages
- run: yarn doc
- run: git add -f docs
- run: git -c user.name="$(whoami)" commit -m github-pages
- run: git remote add github "https://github:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
env: { GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" }
- run: git subtree push --prefix docs github gh-pages

26
.github/workflows/github-pages.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: github-pages
on:
push:
branches: [master]
jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with: { node-version: lts/*, cache: yarn }
- name: Git config
run: |
git config user.name bot
git config user.email bot@example
- name: Build
run: |
git subtree add --prefix docs origin gh-pages
yarn
yarn doc
- name: Publish
run: |
git add -f docs
if git commit -m update; then
git subtree push --prefix docs origin gh-pages
fi