Build the static html files for API documenation. #6
Workflow file for this run
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: 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 and push | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
push: true | |
tags: | | |
${{ secrets.HARBOR_REGISTRY_URL }}/$HARBOR_PROJECT/$IMAGE_NAME:latest | |
${{ secrets.HARBOR_REGISTRY_URL }}/$HARBOR_PROJECT/$IMAGE_NAME:$TAG | |