docker build
This commit is contained in:
@@ -5,7 +5,12 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- '_docs/**'
|
- '.docs/**'
|
||||||
|
|
||||||
|
env:
|
||||||
|
DOCKER_REGISTRY: registry.dutchie031.net
|
||||||
|
DOCKER_IMAGE: spearhead-docs
|
||||||
|
DOCKER_TAG: latest
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
## Run replacements and cleanups on the docs
|
## Run replacements and cleanups on the docs
|
||||||
@@ -17,6 +22,27 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
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
|
- name: Upload spearhead.lua artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
@@ -24,7 +50,6 @@ jobs:
|
|||||||
path: ./.docs/**/*
|
path: ./.docs/**/*
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
|
|
||||||
build-image:
|
build-image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -34,11 +59,20 @@ jobs:
|
|||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: spearhead-docs
|
name: spearhead-docs
|
||||||
|
path: ./spearhead-docs
|
||||||
|
|
||||||
- name: Build Docker image for docs
|
- name: Build Docker image for docs
|
||||||
run: |
|
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 }}
|
||||||
|
|
||||||
|
|
||||||
|
deploy-container:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Temp
|
||||||
|
run: |
|
||||||
|
echo "TEMP"
|
||||||
Reference in New Issue
Block a user