Merge pull request #164 from DrDaveD/pick163 #150
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: publish | |
on: | |
push: | |
branches: | |
- main | |
- 1.* | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: github.repository == 'apptainer/apptainer-admindocs' | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Update repositories | |
run: | | |
sudo apt update | |
- name: Install LaTeX dependencies | |
run: | | |
sudo apt-get install -f -y texlive-latex-extra latexmk | |
- name: Setup Python | |
uses: actions/setup-python@v1 | |
- name: Install Sphinx | |
run: | | |
# docutils=0.16 is a temporary downgrade to fix bullet list rendering | |
# see https://stackoverflow.com/questions/67542699/readthedocs-sphinx-not-rendering-bullet-list-from-rst-file | |
# Once fixed, it can be removed from the list because it is | |
# otherwise an implied dependency | |
pip install --user --upgrade --upgrade-strategy eager docutils==0.16 sphinx sphinx-rtd-theme sphinx-copybutton restructuredtext_lint pygments | |
- name: Build web documentation | |
run: | | |
make html | |
- name: Build PDF documentation | |
run: | | |
make latexpdf | |
- name: Build EPUB documentation | |
run: | | |
make epub | |
- name: Install SSH key | |
env: | |
SSH_AUTH_SOCK: /tmp/ssh_agent.sock | |
run: | | |
mkdir -p ~/.ssh | |
ssh-keyscan github.com >> ~/.ssh/known_hosts | |
echo "${{ secrets.GH_DEPLOY_KEY }}" > ~/.ssh/id_rsa | |
chmod 600 ~/.ssh/id_rsa | |
cat <<EOT >> ~/.ssh/config | |
Host github.com | |
HostName github.com | |
IdentityFile ~/.ssh/id_rsa | |
EOT | |
git config --global user.email "[email protected]" | |
git config --global user.name "gh-actions" | |
- name: Update website repo | |
run: | | |
git clone [email protected]:apptainer/apptainer.org.git ~/apptainer.org | |
rm -rf ~/apptainer.org/public/docs/admin/${GITHUB_REF##*/} | |
cp -r _build/html ~/apptainer.org/public/docs/admin/${GITHUB_REF##*/} | |
cd ~/apptainer.org/public/docs/admin/ | |
version=`ls -1 | grep -E "^[0-9\.]+$" | sort -V | tail -n 1` | |
ln -sfn ${version} ~/apptainer.org/public/docs/admin/latest | |
cd ~/apptainer.org | |
git add public/docs/admin/${GITHUB_REF##*/} public/docs/admin/latest | |
git commit -m "Update ${GITHUB_REF##*/} admindocs" | |
git push |