Skip to content

docs: add phpdoc description to AvailableInterface #100

docs: add phpdoc description to AvailableInterface

docs: add phpdoc description to AvailableInterface #100

Workflow file for this run

# Simple workflow for deploying static content to GitHub Pages
name: Documentation
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
SWAGGER_UI_VERSION: 5.17.10
COMMIT_ID: "${{ github.event.pull_request.head.sha || github.sha }}"
BUILD_VERSION: "0.0_0-dev-${{ github.event.pull_request.head.sha || github.sha }}"
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true
jobs:
build_pkg:
runs-on: self-hosted
strategy:
matrix:
include:
- freebsd_version: FreeBSD-14.0-CURRENT
freebsd_id: freebsd14
steps:
- uses: actions/checkout@v3
- name: Setup FreeBSD build VM
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.freebsd_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{ matrix.freebsd_version }} restore initial
/usr/local/bin/VBoxManage startvm ${{ matrix.freebsd_version }} --type headless
sleep 5
- name: Build pfSense-pkg-RESTAPI on FreeBSD
run: |
/usr/bin/ssh -o StrictHostKeyChecking=no -o LogLevel=quiet ${{ matrix.freebsd_version }}.jaredhendrickson.com 'sudo pkill ntpd || true && sudo ntpdate pool.ntp.org || true'
/usr/bin/ssh -o StrictHostKeyChecking=no -o LogLevel=quiet ${{ matrix.freebsd_version }}.jaredhendrickson.com 'sudo pkg-static install -y php81-extensions'
/usr/local/bin/python3 tools/make_package.py --host ${{ matrix.freebsd_version }}.jaredhendrickson.com --branch ${{ env.COMMIT_ID }} --tag ${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}
- name: Teardown FreeBSD build VM
if: "${{ always() }}"
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.freebsd_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{matrix.freebsd_version}} restore initial
- uses: actions/upload-artifact@v3
with:
name: pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}.pkg
path: pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}.pkg
build_openapi:
runs-on: self-hosted
needs: [build_pkg]
strategy:
matrix:
include:
- pfsense_version: pfSense-2.7.2-RELEASE
freebsd_id: freebsd14
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}.pkg
path: pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}.pkg
- name: Setup pfSense VM
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.pfsense_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{ matrix.pfsense_version }} restore initial
/usr/local/bin/VBoxManage startvm ${{ matrix.pfsense_version }} --type headless
sleep 5
# This is only necessary until GitHub Actions allows an easier way to get a URL to download the artifact within pfSense
- name: Copy pfSense-pkg-RESTAPI build to pfSense
run: |
pfsense-vshell --host ${{ matrix.pfsense_version }}.jaredhendrickson.com -u admin -p pfsense -c 'pfSsh.php playback enablesshd' -k
pfsense-vshell --host ${{ matrix.pfsense_version }}.jaredhendrickson.com -u admin -p pfsense -c "mkdir /root/.ssh/ && echo $(cat ~/.ssh/id_rsa.pub) > /root/.ssh/authorized_keys" -k
scp -o StrictHostKeyChecking=no pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}.pkg/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}.pkg admin@${{ matrix.pfsense_version }}.jaredhendrickson.com:/tmp/
- name: Install pfSense-pkg-RESTAPI on pfSense
run: |
ssh -o StrictHostKeyChecking=no -o LogLevel=quiet admin@${{ matrix.pfsense_version }}.jaredhendrickson.com "pkg -C /dev/null add /tmp/pfSense-pkg-RESTAPI-${{ env.BUILD_VERSION }}-${{ matrix.freebsd_id }}.pkg"
sleep 5
- name: Fetch OpenAPI schema from pfSense
run: curl -s -k -u admin:pfsense -X GET https://${{ matrix.pfsense_version }}.jaredhendrickson.com/api/v2/schema > openapi.json
- name: Teardown pfSense VM
if: "${{ always() }}"
run: |
/usr/local/bin/VBoxManage controlvm ${{ matrix.pfsense_version }} poweroff || true
/usr/local/bin/VBoxManage snapshot ${{ matrix.pfsense_version }} restore initial
- uses: actions/upload-artifact@v3
with:
name: openapi.json
path: openapi.json
deploy_docs_site:
needs: [build_openapi]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/[email protected]
- name: Make website directory
run: mkdir ./www
- name: Setup python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Build mkdocs site
run: |
python3 -m pip install -r ./requirements.txt
python3 -m mkdocs build
mv ./site/* ./www/
- name: Download OpenAPI schema
uses: actions/download-artifact@v3
with:
name: openapi.json
path: openapi.json
- name: Build Swagger UI
run: |
mkdir -p ./www/api-docs/
wget -O /tmp/swagger.tar.gz https://github.com/swagger-api/swagger-ui/archive/refs/tags/v${{ env.SWAGGER_UI_VERSION }}.tar.gz
tar -xzf /tmp/swagger.tar.gz -C /tmp/
cp -r /tmp/swagger-ui-${{ env.SWAGGER_UI_VERSION }}/dist/* ./www/api-docs/
cp pfSense-pkg-RESTAPI/files/usr/local/www/api/swagger/index.css ./www/api-docs/index.css
cp openapi.json/openapi.json ./www/api-docs/openapi.json
echo 'window.onload = function() {
window.ui = SwaggerUIBundle({
url: "/api-docs/openapi.json",
dom_id: "#swagger-ui",
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl
],
layout: "StandaloneLayout",
supportedSubmitMethods: []
});
};' > ./www/api-docs/swagger-initializer.js
- name: Build PHP reference documentation
run: |
mkdir ./www/php_reference
wget https://phpdoc.org/phpDocumentor.phar
chmod +x phpDocumentor.phar
./phpDocumentor.phar
mv ./.phpdoc/build/* ./www/php_reference/
- name: Upload artifact
uses: actions/[email protected]
with:
path: "./www"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/[email protected]