update deploy.yml
This commit is contained in:
parent
9148636d66
commit
8e4420b93b
|
@ -16,7 +16,7 @@ jobs:
|
||||||
- name: Install latest mdbook
|
- name: Install latest mdbook
|
||||||
run: |
|
run: |
|
||||||
apt-get update -qq
|
apt-get update -qq
|
||||||
apt-get install -qq --yes jq
|
apt-get install -qq jq
|
||||||
tag="$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')"
|
tag="$(curl 'https://api.github.com/repos/rust-lang/mdbook/releases/latest' | jq -r '.tag_name')"
|
||||||
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
|
url="https://github.com/rust-lang/mdbook/releases/download/${tag}/mdbook-${tag}-x86_64-unknown-linux-gnu.tar.gz"
|
||||||
mkdir mdbook
|
mkdir mdbook
|
||||||
|
@ -28,11 +28,15 @@ jobs:
|
||||||
- name: Push to rendered branch
|
- name: Push to rendered branch
|
||||||
run: |
|
run: |
|
||||||
hash="$(git log -n 1 --format=reference)"
|
hash="$(git log -n 1 --format=reference)"
|
||||||
git branch -D rendered || true
|
git branch -D rendered &> /dev/null || true
|
||||||
git worktree add -b rendered --orphan dist
|
git worktree add --detach --no-checkout dist
|
||||||
mv dist/.git book/.git
|
mv dist/.git book/.git
|
||||||
|
rmdir dist
|
||||||
mv book/ dist/
|
mv book/ dist/
|
||||||
cd dist
|
cd dist
|
||||||
|
git switch --orphan=rendered
|
||||||
git add .
|
git add .
|
||||||
|
git config user.name "CI"
|
||||||
|
git config user.email "ci@noreply.libre-chip.org"
|
||||||
git commit -n -m "rendered version of $hash"
|
git commit -n -m "rendered version of $hash"
|
||||||
git push -f origin rendered
|
git push -f origin rendered
|
Loading…
Reference in a new issue