Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Fix docs workflow (#4107)
Browse files Browse the repository at this point in the history
* fix docs build

* only run docker and docs in main repo
  • Loading branch information
epwalsh authored Apr 21, 2020
1 parent 10fdf27 commit 15e6b03
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
# Only run this action on "allenai/allennlp", and not forks.
if: github.repository == 'allenai/allennlp'

steps:
- uses: actions/checkout@v2
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ on:
jobs:
build:
runs-on: ubuntu-latest
# Only run this action on "allenai/allennlp", and not forks.
if: github.repository == 'allenai/allennlp'
strategy:
matrix:
python: ['3.7'] # no need to build against multiple versions for now.
Expand Down Expand Up @@ -71,12 +73,17 @@ jobs:
ssh-keyscan github.com >> ~/.ssh/known_hosts
# Checkout allennlp-docs to /allennlp-docs
mkdir -p /ssh
echo $DOCS_DEPLOY_KEY > /ssh/allennlp-docs.key
ssh-add /ssh/allennlp-docs.key
GIT_SSH_COMMAND='ssh -i /ssh/allennlp-docs.key' git clone git@github.com:allenai/allennlp-docs.git /allennlp-docs
echo $DOCS_DEPLOY_KEY > ~/allennlp-docs.key
ssh-add ~/allennlp-docs.key
GIT_SSH_COMMAND='ssh -i ~/allennlp-docs.key' git clone git@github.com:allenai/allennlp-docs.git ~/allennlp-docs
# Copy the generated docs to the checked out docs repo
rm -rf /allennlp-docs/$DIRECTORY/
mkdir -p /allennlp-docs/$DIRECTORY
cp -r site/* /allennlp-docs/$DIRECTORY
rm -rf ~/allennlp-docs/$DIRECTORY/
mkdir -p ~/allennlp-docs/$DIRECTORY
cp -r site/* ~/allennlp-docs/$DIRECTORY
# And push them up to GitHub
cd ~/allennlp-docs/$DIRECTORY
git add .
git commit -m "automated update of the docs"
GIT_SSH_COMMAND='ssh -i ~/allennlp-docs.key' git push

0 comments on commit 15e6b03

Please sign in to comment.