Migrate to GitHub Actions #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Captum Deploy Website | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
workflow_dispatch: | ||
env: | ||
CHANNEL: "nightly" | ||
jobs: | ||
tests: | ||
uses: pytorch/test-infra/.github/workflows/linux_job.yml@main | ||
with: | ||
runner: linux.12xlarge | ||
docker-image: cimg/python:3.6-node | ||
repository: pytorch/captum | ||
env: | ||
DOCUSAURUS_GITHUB_TOKEN: ${{ secrets.DOCUSAURUS_GITHUB_TOKEN }} | ||
script: | | ||
sudo chmod -R 777 . | ||
./scripts/install_via_pip.sh -n -d | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Captum website deployment script" | ||
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_GITHUB_TOKEN" > ~/.netrc | ||
if ! git diff --name-only HEAD^ | grep -E "(^captum\/.*)|(^\.circleci\/.*)|(^docs\/.*)|(^website\/.*)|(^scripts\/.*)|(^sphinx\/.*)|(^tutorials\/.*)"; then | ||
echo "Skipping deploy. No relevant website files have changed" | ||
else | ||
mkdir -p website/static/.circleci && cp -a .circleci/. website/static/.circleci/. | ||
./scripts/build_docs.sh -b | ||
cd website | ||
GIT_USER=docusaurus-bot yarn run publish-gh-pages | ||
fi |