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: ...@@ -4,7 +4,6 @@ on:
pull_request: pull_request:
push: push:
branches: branches:
- nightly
- main - main
- release/* - release/*
tags: tags:
...@@ -35,13 +34,14 @@ jobs: ...@@ -35,13 +34,14 @@ jobs:
export PYTHON_VERSION="${{ matrix.python_version }}" export PYTHON_VERSION="${{ matrix.python_version }}"
export CU_VERSION="${{ matrix.cuda_arch_version }}" export CU_VERSION="${{ matrix.cuda_arch_version }}"
export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}" export CUDATOOLKIT="pytorch-cuda=${CU_VERSION}"
export BUILD_VERSION="$( cut -f 1 -d a version.txt )".dev"$(date "+%Y%m%d")"
# Set CHANNEL # Set CHANNEL
if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then if [[(${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
export CHANNEL=test export CHANNEL=test
export BUILD_VERSION="$( cut -f 1 -d a version.txt )"
else else
export CHANNEL=nightly export CHANNEL=nightly
export BUILD_VERSION="$( cut -f 1 -d a version.txt )".dev"$(date "+%Y%m%d")"
fi fi
echo "::group::Create conda env" echo "::group::Create conda env"
...@@ -88,8 +88,8 @@ jobs: ...@@ -88,8 +88,8 @@ jobs:
cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}" cp -rf docs/build/html/* "${RUNNER_DOCS_DIR}"
mv docs/build/html /artifacts/ mv docs/build/html /artifacts/
commit: commit-main:
if: ${{ (github.repository == 'pytorch/audio') && ((github.event_name == 'push') && (github.ref_name == 'nightly')) }} if: ${{ (github.repository == 'pytorch/audio') && (github.ref_name == 'main') }}
permissions: permissions:
# Required for `git push` # Required for `git push`
# Note: # Note:
...@@ -107,7 +107,7 @@ jobs: ...@@ -107,7 +107,7 @@ jobs:
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: docs name: docs
- name: Update nightly doc - name: Update main doc
run: | run: |
set -x set -x
...@@ -116,7 +116,7 @@ jobs: ...@@ -116,7 +116,7 @@ jobs:
# When `git clone`, `gh-pages` branch is fetched by default. # When `git clone`, `gh-pages` branch is fetched by default.
# The size of gh-pages grows significantly, so we use ammend and force push # The size of gh-pages grows significantly, so we use ammend and force push
# We add a new commit once a week # We add a new commit once a week
if [ "date +%u" = "1" ]; then if [ "$(date +%d)" = "1" ]; then
git commit --allow-empty -m "placeholder" git commit --allow-empty -m "placeholder"
fi 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