Merge pull request #4 from ifilot/develop #7
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: Docs | |
on: | |
push: | |
branches: [ "docs" ] | |
pull_request: | |
branches: [ "docs" ] | |
jobs: | |
build-docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install packages | |
run: sudo apt update && sudo apt install -y git build-essential curl wget python3 python3-pip texlive texlive-pictures texlive-latex-extra pdf2svg poppler-utils netpbm imagemagick ghostscript | |
- name: Install Python packages | |
run: sudo pip install sphinx sphinx-rtd-theme sphinxcontrib-tikz numpy scipy pylebedev pyqint mendeleev | |
- name: Build documentation | |
run: cd docs && make html | |
- name: Upload math result for job 1 | |
uses: actions/upload-artifact@v3 | |
with: | |
name: html-docs | |
path: ./docs/_build/html | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build-docs | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Download docs | |
uses: actions/download-artifact@v3 | |
with: | |
name: html-docs | |
path: html-docs | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
ghcr.io/ifilot/pydft-docs-nginx | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push Docker images | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: doc.Dockerfile | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |