Skip to content

Commit

Permalink
Upgrade documentation skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-helldar committed Dec 5, 2023
1 parent a533dcf commit f8ccbe2
Show file tree
Hide file tree
Showing 33 changed files with 411 additions and 529 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
.requests/ export-ignore
.run/ export-ignore

docs/ export-ignore
tests/ export-ignore

.gitattributes export-ignore
Expand Down
3 changes: 0 additions & 3 deletions .github/FUNDING.yml

This file was deleted.

138 changes: 138 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
name: Documentation

on:
push:
branches:
- main
- 4.x
workflow_dispatch:

permissions:
id-token: write
pages: write

env:
ARTIFACT: webHelpCASHBOX2-all.zip
CONFIG_JSON_PRODUCT: CASHBOX
CONFIG_JSON_VERSION: 4.x
INSTANCE: docs/cashbox
DOMAIN_NAME: cashbox.city
BUILDER_VERSION: 232.10275

jobs:
build:
name: Build Application
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, simplexml
coverage: xdebug

- name: Configure git
run: git config --global --add safe.directory /github/workspace

- name: Install dependencies
run: composer update --no-progress --no-interaction

- name: Build documentation
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.BUILDER_VERSION }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7

test:
needs: build
name: Testing
runs-on: ubuntu-latest

steps:
- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: docs
path: artifacts

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}

robots:
needs: build
name: Generate robots.txt
runs-on: ubuntu-latest

steps:
- name: Create robots.txt
run: |
touch robots.txt
echo "User-Agent: *" >> robots.txt
echo "Disallow: " >> robots.txt
echo "Host: https://${{ env.DOMAIN_NAME }}" >> robots.txt
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: robots
path: robots.txt
retention-days: 7

deploy-pages:
environment:
name: deploy
url: ${{ steps.deployment.outputs.page_url }}

needs:
- test
- robots

name: Deploy to Pages
runs-on: ubuntu-latest

steps:
- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: docs

- name: Download robots artifact
uses: actions/download-artifact@v3
with:
name: robots

- name: Unzip artifact
uses: montudor/action-zip@v1
with:
args: unzip -qq ${{ env.ARTIFACT }} -d dir

- name: Move robots
run: |
sudo mv robots.txt dir/robots.txt
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: dir

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
57 changes: 57 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ name: Tests

on: [ push, pull_request ]

permissions: read-all

env:
INSTANCE: docs/cashbox
ARTIFACT: webHelpCASHBOX2-all.zip
BUILDER_VERSION: 232.10275

jobs:
linux:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -91,3 +98,53 @@ jobs:
DB_CONNECTION: mysql
DB_USERNAME: root
DB_PORT: ${{ job.services.mysql.ports[3306] }}

documentation_build:
name: Build Documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, mbstring, zip, pcntl, pdo, pdo_sqlite, iconv, simplexml
coverage: xdebug

- name: Configure git
run: git config --global --add safe.directory /github/workspace

- name: Build documentation
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT }}
docker-version: ${{ env.BUILDER_VERSION }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT }}
artifacts/report.json
retention-days: 7

documentation_test:
needs: build
name: Test Documentation
runs-on: ubuntu-latest

steps:
- name: Download docs artifact
uses: actions/download-artifact@v3
with:
name: docs
path: artifacts

- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
3 changes: 0 additions & 3 deletions docs/.env.example

This file was deleted.

3 changes: 0 additions & 3 deletions docs/.github/FUNDING.yml

This file was deleted.

7 changes: 0 additions & 7 deletions docs/.github/dependabot.yml

This file was deleted.

13 changes: 0 additions & 13 deletions docs/.github/workflows/close-pull-request.yml

This file was deleted.

42 changes: 0 additions & 42 deletions docs/.github/workflows/docs.yml

This file was deleted.

18 changes: 0 additions & 18 deletions docs/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions docs/LICENSE

This file was deleted.

55 changes: 0 additions & 55 deletions docs/README.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/c.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE categories
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd">
<categories>
<category id="drivers-list" name="Drivers" order="1" />
</categories>
Loading

0 comments on commit f8ccbe2

Please sign in to comment.