Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit3d350f7

Browse files
authored
Merge pull request#1224 from nicholasbishop/bishop-book-release-2
book: Publish the latest release instead of main
2 parents4e4e190 +44ae084 commit3d350f7

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

‎.github/workflows/book.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: Book
22
on:
33
push:
44
branches:[main]
5+
tags:['*']
56
permissions:
67
contents:write
78
# Adapted from:
@@ -21,24 +22,32 @@ jobs:
2122
echo `pwd`/mdbook >> $GITHUB_PATH
2223
-name:Deploy GitHub Pages
2324
run:|
24-
cd book
25-
mdbook build
26-
git worktree add gh-pages gh-pages
25+
# Configure git user so that `git commit` works.
2726
git config user.name "Deploy from CI"
2827
git config user.email ""
29-
cd gh-pages
28+
29+
# Get the highest `uefi` release tag.
30+
highest_tag="$(git tag --list | grep uefi-v | sort -V | tail -1)"
31+
32+
# Create a worktree for the tag.
33+
git worktree add wt-tag refs/tags/"${highest_tag}"
34+
35+
# Create a worktree for the `gh-pages` branch.
36+
git worktree add wt-gh-pages gh-pages
37+
3038
# Delete the ref to avoid keeping history.
31-
git update-ref -d refs/heads/gh-pages
32-
# Place the book under a "HEAD" directory so that we can later
33-
# add other versions (e.g. "stable" or "v0.17") without breaking
34-
# URLs.
35-
rm -rf HEAD
36-
mv ../book HEAD
37-
git add HEAD
38-
# Add an index in the root to redirect to HEAD. If we eventually
39-
# serve multiple versions, this can be changed to a real index.
40-
cp ../head_redirect.html index.html
41-
git add index.html
39+
git -C wt-gh-pages update-ref -d refs/heads/gh-pages
40+
41+
# Build the book for the tag. Don't use `--dest-dir` because it will
42+
# delete the destination directory including the worktree checkout's
43+
# ".git".
44+
mdbook build wt-tag/book
45+
# Copy output to the destination directory. Note the "/." is needed at
46+
# the end of the source path so that hidden files are included.
47+
cp -r wt-tag/book/book/. wt-gh-pages
48+
4249
# Commit and push.
50+
cd wt-gh-pages
51+
git add .
4352
git commit -m "Deploy $GITHUB_SHA to gh-pages"
4453
git push --force

‎book/head_redirect.html

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp