Merge pull request #382 from xypp3/main #304
This file contains hidden or 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-userdocs' | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: recursive | |
| - name: Setup Go | |
| uses: actions/setup-go@v2 | |
| with: | |
| go-version: 1.21.9 | |
| - name: Update repositories | |
| run: | | |
| sudo apt update | |
| - name: Install Apptainer dependencies | |
| run: | | |
| sudo apt-get install -f -y build-essential libssl-dev uuid-dev squashfs-tools libseccomp-dev cryptsetup-bin libgpgme-dev | |
| - 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.21 is a temporary downgrade to fix a compiling issue | |
| # see https://github.com/CrossNox/m2r2/issues/68 | |
| # Note any change here also has to go into pull_request.yml | |
| # and in apptainer-admindocs publish.yml | |
| pip install --user --upgrade --upgrade-strategy eager "docutils<0.21" setuptools sphinx sphinx-rtd-theme restructuredtext_lint pygments m2r2 | |
| - 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 "actions@github.com" | |
| git config --global user.name "gh-actions" | |
| - name: Update website repo | |
| run: | | |
| git clone git@github.com:apptainer/apptainer.org.git ~/apptainer.org | |
| rm -rf ~/apptainer.org/public/docs/user/${GITHUB_REF##*/} | |
| cp -r _build/html ~/apptainer.org/public/docs/user/${GITHUB_REF##*/} | |
| cd ~/apptainer.org/public/docs/user/ | |
| version=`ls -1 | grep -E "^[0-9\.]+$" | sort -V | tail -n 1` | |
| ln -sfn ${version} ~/apptainer.org/public/docs/user/latest | |
| cd ~/apptainer.org | |
| git add public/docs/user/${GITHUB_REF##*/} public/docs/user/latest | |
| git commit -m "Update ${GITHUB_REF##*/} userdocs" | |
| git push |