From 215649f60a35c2f2f24c7ae016e7c8bb351b7098 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Sun, 25 Jul 2021 00:08:56 +0900 Subject: [PATCH] use actions/setup-node@v2, actions/checkout@v2 --- .github/workflows/docs.yml | 25 ------------------------- .github/workflows/github-pages.yml | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/github-pages.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index dc4725d..0000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -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 diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000..1c5efbf --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -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