aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2024-05-06 13:17:29 +0900
committerKazuki Yamaguchi <k@rhe.jp>2024-06-08 20:20:51 +0900
commit0a133bb27ee2c13e2521c1f8a2cc5d023294e46f (patch)
treef976c8736f6920f0bb4f0771886af2fdc3d36100
parentb6b71e735113849bd859cf3ad80e35cb1bfdb306 (diff)
downloadruby-openssl-0a133bb27ee2c13e2521c1f8a2cc5d023294e46f.tar.gz
Automatically update GitHub Pages from master branchky/actions-github-pages
Remove tool/update-gh-pages as it is no longer necessary.
-rw-r--r--.github/workflows/github-pages.yml37
-rwxr-xr-xtool/update-gh-pages22
2 files changed, 37 insertions, 22 deletions
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"
-)