Skip to content

Updated GitHub Pages #2

Updated GitHub Pages

Updated GitHub Pages #2

Workflow file for this run

name: On Push Actions
on:
push:
branches:
- 'master'
paths-ignore:
- 'docs/**'
- 'resources/java-runtime**'
jobs:
updateremotepanel:
name: Update Remote Panel
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Copy Files
run: |
echo ::group::update docs/panel/
rm -rf docs/panel/
cp -rv resources/web/panel docs
echo ::endgroup::
echo ::group::update docs/common/
rm -rf docs/common/
cp -rv resources/web/common docs
echo ::endgroup::
- name: Make Path File
run: |
echo docs/panel/ >> paths.txt
echo docs/common/ >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsremotepanel
path: |
docs/common/**
docs/panel/**
paths.txt
if-no-files-found: error
retention-days: 1
parsecommandtags:
name: Parse Command Tags on ubuntu-latest with Python 3.x
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Execute Script
run: python3 development-resources/parse_transformers.py
- name: Make Path File
run: |
echo docs/guides/content/commands/command-variables.md >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docstransformers
path: |
docs/guides/content/commands/command-variables.md
paths.txt
if-no-files-found: error
retention-days: 1
parseconsolecommands:
name: Parse Console Commands on ubuntu-latest with Python 3.x
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Execute Script
run: python3 development-resources/parse_consolecommands.py
- name: Make Path File
run: |
echo docs/guides/content/commands/console-commands.md >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsconsolecommands
path: |
docs/guides/content/commands/console-commands.md
paths.txt
if-no-files-found: error
retention-days: 1
parsebotproperties:
name: Parse Bot Properties on ubuntu-latest with Python 3.x
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Execute Script
run: python3 development-resources/parse_botproperties.py
- name: Make Path File
run: |
echo docs/guides/content/setupbot/properties.md >> paths.txt
echo resources/web/common/json/properties.json >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsbotproperties
path: |
docs/guides/content/setupbot/properties.md
resources/web/common/json/properties.json
paths.txt
if-no-files-found: error
retention-days: 1
javadoc:
name: Generate JavaDoc on ubuntu-latest
if: github.repository == 'PhantomBot/PhantomBot'
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'
architecture: 'x64'
- name: Set up Ant
run: sudo apt-get install ant
- name: Backup Zips
continue-on-error: true
run: mkdir -p /tmp/javadoczips && cp -fv docs/javadoc/*.zip /tmp/javadoczips/
- name: Retrieve Libs with Ant
run: ant -noinput -buildfile build.xml ivy-retrieve
- name: JavaDoc with Ant
run: ant -noinput -buildfile build.xml javadoc
- name: Execute Script
run: python3 development-resources/clean_javadoc.py
- name: Copy Files
run: |
echo ::group::update docs/javadoc/
rm -rf docs/javadoc/
cp -rv dist/javadoc docs
echo ::endgroup::
- name: Verify Changed files
uses: tj-actions/verify-changed-files@v20
id: verify-changed-files
with:
files: |
docs/javadoc/**
!docs/javadoc/*.zip
- name: Revert Zips
continue-on-error: true
if: steps.verify-changed-files.outputs.files_changed == 'false'
run: cp -fv /tmp/javadoczips/*.zip docs/javadoc/
- name: Make Path File
run: |
echo docs/javadoc/ >> paths.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: docsjavadoc
path: |
docs/javadoc/**
paths.txt
if-no-files-found: error
retention-days: 1
commit:
name: Commit Docs
runs-on: ubuntu-latest
needs: [updateremotepanel, parsecommandtags, parseconsolecommands, parsebotproperties, javadoc]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
ref: 'master'
- name: Prep Artifact Dir
run: mkdir -p /tmp/docartifacts
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: /tmp/docartifacts
- name: Copy Files
run: for d in /tmp/docartifacts/docs*; do while read p; do echo ::group::update $p; rm -rf $p; cp -rv $d/$p $p; echo ::endgroup::; done < $d/paths.txt; done
- name: Commit Changes
uses: EndBug/add-and-commit@v9
with:
message: Updated GitHub Pages
default_author: github_actions