Davide Pesavento | 6b2bb62 | 2023-01-12 22:00:44 -0500 | [diff] [blame] | 1 | name: Publish |
| 2 | on: |
| 3 | push: |
| 4 | branches: |
| 5 | - master |
| 6 | paths-ignore: |
| 7 | - '.mailmap' |
| 8 | - 'README.md' |
| 9 | workflow_dispatch: |
| 10 | |
| 11 | permissions: |
| 12 | contents: read |
| 13 | |
| 14 | jobs: |
| 15 | HTML: |
| 16 | runs-on: ubuntu-latest |
| 17 | concurrency: docs.named-data.net |
| 18 | environment: |
| 19 | name: docs.named-data.net |
| 20 | url: https://docs.named-data.net/NDN-packet-spec/${{ steps.version.outputs.version }}/ |
| 21 | steps: |
| 22 | - name: Checkout |
| 23 | uses: actions/checkout@v3 |
| 24 | - name: Extract version |
| 25 | id: version |
| 26 | run: | |
| 27 | v=$(sed -nE "s/^version\s*=\s*['\"]([0-9]+(\.[0-9]+){0,3})['\"]/\1/p" conf.py) |
| 28 | if [[ -z $v ]]; then |
| 29 | echo "::error::Could not find a valid version in conf.py" |
| 30 | exit 1 |
| 31 | fi |
| 32 | echo "::notice::Publishing version $v" |
| 33 | echo "version=$v" >> $GITHUB_OUTPUT |
| 34 | - name: Set up Python |
| 35 | uses: actions/setup-python@v4 |
| 36 | with: |
| 37 | python-version: '3.10' |
| 38 | - name: Install dependencies |
| 39 | run: | |
| 40 | python -m pip install --upgrade pip |
| 41 | pip install -r requirements.txt |
| 42 | - name: Generate HTML pages |
| 43 | run: make html |
| 44 | env: |
| 45 | SPHINXOPTS: --color |
| 46 | - name: Publish HTML pages |
| 47 | uses: easingthemes/ssh-deploy@v4 |
| 48 | with: |
| 49 | ARGS: -chirvEW --delay-updates --delete-delay |
| 50 | REMOTE_HOST: ${{ vars.DOCS_DEPLOYMENT_HOST }} |
| 51 | REMOTE_PORT: ${{ secrets.DOCS_DEPLOYMENT_PORT }} |
| 52 | REMOTE_USER: ${{ secrets.DOCS_DEPLOYMENT_USER }} |
| 53 | SSH_PRIVATE_KEY: ${{ secrets.DOCS_DEPLOYMENT_SSH_KEY }} |
| 54 | SOURCE: _build/html/ |
| 55 | TARGET: /srv/docs/NDN-packet-spec/${{ steps.version.outputs.version }}/ |
Davide Pesavento | 16c9fd2 | 2023-01-17 22:08:10 -0500 | [diff] [blame^] | 56 | |
| 57 | PDF: |
| 58 | runs-on: ubuntu-latest |
| 59 | steps: |
| 60 | - name: Checkout |
| 61 | uses: actions/checkout@v3 |
| 62 | - name: Set up Python |
| 63 | uses: actions/setup-python@v4 |
| 64 | with: |
| 65 | python-version: '3.10' |
| 66 | - name: Install dependencies |
| 67 | run: | |
| 68 | sudo apt-get -qq update |
| 69 | sudo apt-get -qy install --no-install-recommends latexmk \ |
| 70 | texlive-latex-extra texlive-fonts-recommended tex-gyre |
| 71 | python -m pip install --upgrade pip |
| 72 | pip install -r requirements.txt |
| 73 | - name: Generate PDF document |
| 74 | run: make latexpdf |
| 75 | env: |
| 76 | SPHINXOPTS: --color |
| 77 | - name: Publish PDF document |
| 78 | uses: actions/upload-artifact@v3 |
| 79 | with: |
| 80 | name: ndn-packet-spec |
| 81 | path: _build/latex/ndn-packet-spec.pdf |
| 82 | if-no-files-found: error |