Merge pull request #262 from nbelakovski-mssm/update_docker_docs #48
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: Update Docs | |
on: | |
push: | |
branches: [master] | |
jobs: | |
generate-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: "gh-pages" | |
- name: Create conda environment | |
run: conda create --quiet -c conda-forge --name deid | |
- name: Install deid | |
run: | | |
export PATH="/usr/share/miniconda/bin:$PATH" | |
root=$PWD | |
source activate deid | |
cd /tmp | |
git clone https://github.com/pydicom/deid | |
cd deid | |
pip install -e . | |
pip install deid-data | |
cd ./docs | |
pip install -r api_docs/docs-requirements.txt | |
/bin/bash ./apidoc.sh | |
cd ../ | |
mv $root/.git ./docs/api_docs/.git | |
rm -rf $root | |
mv ./docs/api_docs $root | |
cd $root | |
ls -a | |
git add . | |
git status | |
git config --global user.name "github-actions" | |
git config --global user.email "[email protected]" | |
git config --global pull.rebase true | |
if git diff-index --quiet HEAD --; then | |
printf "No changes\n" | |
else | |
printf "Changes\n" | |
git commit -a -m "Adding changed documentation files" | |
git push origin gh-pages || echo "up to date" | |
fi |