From 0a133bb27ee2c13e2521c1f8a2cc5d023294e46f Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Mon, 6 May 2024 13:17:29 +0900 Subject: Automatically update GitHub Pages from master branch Remove tool/update-gh-pages as it is no longer necessary. --- .github/workflows/github-pages.yml | 37 +++++++++++++++++++++++++++++++++++++ tool/update-gh-pages | 22 ---------------------- 2 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/github-pages.yml delete mode 100755 tool/update-gh-pages diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 00000000..f1e5bf18 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,37 @@ +name: GitHub Pages + +on: + push: + branches: + - master + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ruby + bundler-cache: true + - run: bundle install + - run: rake rdoc + - name: Upload GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 + with: + path: html + + deploy: + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/tool/update-gh-pages b/tool/update-gh-pages deleted file mode 100755 index 8eb546a9..00000000 --- a/tool/update-gh-pages +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -set -e - -# Generates RDoc HTML and update gh-pages branch. - -HEAD_DESCRIPTION=$(git describe --dirty --always --abbrev=12) - -[ -d html ] && - rm -r html -rake rdoc - -[ ! -d tmp/gh-pages ] && - git worktree add tmp/gh-pages gh-pages -( - cd tmp/gh-pages - - git rm -r . - cp -r ../../html/* . - rm created.rid js/*.gz # to avoid unnecessary change :x - git add . - git commit -m "Sync with $HEAD_DESCRIPTION" -) -- cgit v1.2.3