Added sudo to creating phpdoc in order to be able to create directory #25
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: Generate MkDocs and upload | |
on: | |
push: | |
branches: | |
- docs | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install mkdocs | |
pip3 install $(mkdocs get-deps) | |
sudo apt-get update | |
sudo apt-get install php | |
sudo apt-get install -y lftp | |
sudo apt-get install nodejs | |
sudo apt-get install npm | |
sudo npm i openapi-to-md -g | |
- name: Start Hashtopolis server | |
uses: ./.github/actions/start-hashtopolis | |
- name: Download newest apiv2 spec | |
run: | | |
wget http://localhost:8080/api/v2/openapi.json -P /tmp/ | |
openapi-to-md /tmp/openapi.json /docs/api/ | |
- name: Create function level documentation with phpdocumentor | |
run: | | |
wget https://phpdoc.org/phpDocumentor.phar -P /tmp/ | |
sudo php /tmp/phpDocumentor.phar --ignore vendor/ -d . -t /docs/php-documentor/ | |
- name: Build MkDocs site | |
run: | | |
mkdocs build | |
- name: Upload HTML files to FTP server | |
env: | |
FTP_SERVER: ${{ secrets.FTP_SERVER }} | |
FTP_USERNAME: ${{ secrets.FTP_USERNAME }} | |
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }} | |
run: | | |
lftp -e "mirror -R site/ /; quit" -u $FTP_USERNAME,$FTP_PASSWORD $FTP_SERVER |