Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 24 additions & 20 deletions .github/workflows/core-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,19 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP, with composer and extensions
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: mbstring, dom, fileinfo, mysql
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_ENV
- name: Cache composer dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }}
path: ${{ env.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install current dependencies from composer.lock
Expand All @@ -34,48 +32,54 @@ jobs:
run: phpDocumentor --version
- name: Generate documentation
run: composer run-php-documentor
- name: zip phpdocumentor dir
- name: Zip phpDocumentor directory
run: zip -r phpdocumentor.zip docs/phpdocumentor
- name: Upload generated doc files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: doc-files
path: phpdocumentor.zip
deploy-docs:
name: Deploy Core Docs.
name: Deploy Core Docs
runs-on: ubuntu-20.04
needs: make-restapi-docs
steps:
- name: Checkout phplist/core-docs
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
repository: phpList/core-docs
fetch-depth: 0
token: ${{ secrets.PUSH_CORE_DOCS }}
- name: Restore REST API Spec
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: doc-files
- name: unzip phpdocumentor
- name: Unzip phpDocumentor
run: |
unzip phpdocumentor.zip
rm phpdocumentor.zip
- name: List Files
run: ls
- name: Sync old files with newly generated ones.
- name: Sync old files with newly generated ones
run: rsync -av docs/phpdocumentor/* .
- name: Removed temp dirs
- name: Remove temporary directories
run: rm -rf docs
- name: Check if updates/changes.
- name: Check if updates/changes
run: git status --porcelain > repo-changes.txt
- name: Check changes file
run: cat repo-changes.txt
- name: Verify updates.
- name: Verify updates
id: allow-deploy
run: |
if [ -s repo-changes.txt ]; then echo "Updates made to documentation"; echo '::set-output name=DEPLOY::true'; else echo "No updates made to documentation deployment would be skipped."; echo '::set-output name=DEPLOY::false'; fi
- name: Commit changes and deply
if: ${{ steps.allow-deploy.outputs.DEPLOY == 'true' }}
if [ -s repo-changes.txt ]; then
echo "Updates made to documentation";
echo 'DEPLOY=true' >> $GITHUB_ENV;
else
echo "No updates made to documentation. Deployment would be skipped.";
echo 'DEPLOY=false' >> $GITHUB_ENV;
fi
- name: Commit changes and deploy
if: ${{ env.DEPLOY == 'true' }}
run: |
rm repo-changes.txt
git config user.name "github-actions"
Expand Down
Loading