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

Fix and update doc deployment (#3495)

Summary:
- Fix condition to add new commit to gh-pages
- Allow to deploy docs from workflow dispatch

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

Differential Revision: D47767443

Pulled By: mthrok

fbshipit-source-id: 9ca858868f3e822e532c21cde9d7499af9891a51
parent d4644793
......@@ -4,7 +4,6 @@ on:
pull_request:
push:
branches:
- nightly
- main
- release/*
tags:
......@@ -35,13 +34,14 @@ jobs:
export PYTHON_VERSION="${{ matrix.python_version }}"
export CU_VERSION="${{ matrix.cuda_arch_version }}"
export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}"
export BUILD_VERSION="$( cut -f 1 -d a version.txt )".dev"$(date "+%Y%m%d")"
# Set CHANNEL
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
export CHANNEL=test
export BUILD_VERSION="$( cut -f 1 -d a version.txt )"
else
export CHANNEL=nightly
export BUILD_VERSION="$( cut -f 1 -d a version.txt )".dev"$(date "+%Y%m%d")"
fi
echo "::group::Create conda env"
......@@ -88,8 +88,8 @@ jobs:
cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}"
mv docs/build/html /artifacts/
commit:
if: ${{ (github.repository == 'pytorch/audio') && ((github.event_name == 'push') && (github.ref_name == 'nightly')) }}
commit-main:
if: ${{ (github.repository == 'pytorch/audio') && (github.ref_name == 'main') }}
permissions:
# Required for `git push`
# Note:
......@@ -107,7 +107,7 @@ jobs:
- uses: actions/download-artifact@v3
with:
name: docs
- name: Update nightly doc
- name: Update main doc
run: |
set -x
......@@ -116,7 +116,7 @@ jobs:
# 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
if [ "$(date +%d)" = "1" ]; then
git commit --allow-empty -m "placeholder"
fi
......
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