Commit a79cf3ba authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Amend commit to gh-pages branch (#3345)

Summary:
This commit changes the way doc is pushed.
It ammends instead of adding a new commit.

Currently each commit in gh-pages contain like 100MB of data. gh-pages branch is fetched by default when `git clone`. So the size of torchaudio repo grows significantly.

Pull Request resolved: https://github.com/pytorch/audio/pull/3345

Reviewed By: nateanl

Differential Revision: D46136612

Pulled By: mthrok

fbshipit-source-id: 39479ee5d1a6888254ef50f0db252453d976d183
parent 5a6f4eba
......@@ -142,6 +142,7 @@ jobs:
- uses: actions/checkout@v3
with:
ref: gh-pages
fetch-depth: 5
- uses: actions/download-artifact@v3
with:
name: docs
......@@ -149,13 +150,20 @@ jobs:
run: |
set -x
git config user.name "pytorchbot"
git config user.email "soumith+bot@pytorch.org"
# When `git clone`, `gh-pages` branch is fetched by default.
# The size of gh-pages grows significantly, so we use ammend and force push
# We add a new commit once a week
if [ "date +%u" = "1" ]; then
git commit --allow-empty -m "placeholder"
fi
# TODO: add tag-based process (need to handle the main directory name)
# Update the main doc
rm -rf main
mv html main
# Update the main doc
git add --all main || true
git config user.name "pytorchbot"
git config user.email "soumith+bot@pytorch.org"
git commit -m "auto-generating sphinx docs" || true
git push
git commit --amend -m "auto-generating sphinx docs" || true
git push -f
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment