diff --git a/.gitea/workflows/update-docs.yml b/.gitea/workflows/update-docs.yml index 0523633..0239672 100644 --- a/.gitea/workflows/update-docs.yml +++ b/.gitea/workflows/update-docs.yml @@ -5,7 +5,12 @@ on: branches: - main paths: - - '_docs/**' + - '.docs/**' + +env: + DOCKER_REGISTRY: registry.dutchie031.net + DOCKER_IMAGE: spearhead-docs + DOCKER_TAG: latest jobs: ## Run replacements and cleanups on the docs @@ -17,6 +22,27 @@ jobs: with: fetch-depth: 0 + - name: Install Python Pygments + run: | + python3 -m pip install --upgrade pip + pip install pygments + + - name: Highlight API code and update HTML + run: | + pygmentize -f html -l lua -O noclasses,style=monokai classes/api/SpearheadApiDoc.lua > .docs/pages/temp_api_code.html + # Insert the highlighted code into the placeholder in spearheadapi.html + sed -i '/@@API_CODE@@/r .docs/pages/temp_api_code.html' .docs/pages/spearheadapi.html + sed -i '/@@API_CODE@@/d' .docs/pages/spearheadapi.html + rm .docs/pages/temp_api_code.html + + - name: Highlight API code and update HTML + run: | + pygmentize -f html -l lua -O noclasses,style=monokai ./config.lua > .docs/pages/temp_config_code.html + # Insert the highlighted code into the placeholder in spearheadapi.html + sed -i '/@@CONFIG_CODE@@/r .docs/pages/temp_config_code.html' .docs/pages/reference.html + sed -i '/@@CONFIG_CODE@@/d' .docs/pages/reference.html + rm .docs/pages/temp_config_code.html + - name: Upload spearhead.lua artifact uses: actions/upload-artifact@v3 with: @@ -24,7 +50,6 @@ jobs: path: ./.docs/**/* retention-days: 1 - build-image: runs-on: ubuntu-latest steps: @@ -34,11 +59,20 @@ jobs: uses: actions/download-artifact@v3 with: name: spearhead-docs + path: ./spearhead-docs - - name: Build Docker image for docs run: | - docker build -t spearhead-docs ./_docs + docker build -t ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} ./spearhead-docs + + - name: Push Docker image + run: | + docker push ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE }}:${{ env.DOCKER_TAG }} - \ No newline at end of file + deploy-container: + runs-on: ubuntu-latest + steps: + - name: Temp + run: | + echo "TEMP" \ No newline at end of file