Skip to content

Build the static html files for API documenation. #8

Build the static html files for API documenation.

Build the static html files for API documenation. #8

name: Build API Documentation
run-name: Build the static html files for API documenation.
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build sphinx html output
run: sphinx-build -b html src/ build/
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: build
path: build/
push_image:
runs-on: ubuntu-latest
needs: build
env:
IMAGE_NAME: data-api-doc
HARBOR_PROJECT: data-api-documentation
# TAG : ${{ steps.meta.output.tags }}
TAG : 0.1
steps:
- uses: docker/login-action@v2
with:
registry: ${{ secrets.HARBOR_REGISTRY_URL }}
username: ${{ secrets.HARBOR_REGISTRY_USER }}
password: ${{ secrets.HARBOR_REGISTRY_PASSWORD }}
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: build
- name: Build image
run: docker build --tag ${{ env.IMAGE_NAME }} .
- name: Upload image
run: |
docker tag ${{ env.IMAGE_NAME }} ${{ secrets.HARBOR_REGISTRY_URL }}/${{ env.HARBOR_PROJECT }}/${{ env.IMAGE_NAME }}:latest
docker tag ${{ env.IMAGE_NAME }} ${{ secrets.HARBOR_REGISTRY_URL }}/${{ env.HARBOR_PROJECT }}/${{ env.IMAGE_NAME }}:$TAG
docker push ${{ secrets.HARBOR_REGISTRY_URL }}/${{ env.HARBOR_PROJECT }}/${{ env.IMAGE_NAME }}:latest
docker push ${{ secrets.HARBOR_REGISTRY_URL }}/${{ env.HARBOR_PROJECT }}/${{ env.IMAGE_NAME }}:$TAG