Skip to content

docs

docs #1889

Workflow file for this run

name: Documentation
on:
push:
branches:
- main
workflow_dispatch:
repository_dispatch:
types:
- docs
permissions:
id-token: write
pages: write
env:
COMPOSER_TOKEN: ${{ secrets.COMPOSER_TOKEN }}
ALGOLIA_APP_NAME: ${{ secrets.ALGOLIA_APPLICATION_ID }}
ALGOLIA_ARTIFACT: algolia-indexes-LARAVEL-LANG.zip
ALGOLIA_INDEX_NAME: laravel-lang
ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }}
ARTIFACT_DOCS: webHelpLARAVEL-LANG2-all.zip
ARTIFACT_INDEXES: search-indexes
ARTIFACT_INDEXES_CLEARED: search-indexes-cleared
CONFIG_JSON_PRODUCT: LARAVEL-LANG
CONFIG_JSON_VERSION: main
INSTANCE: docs/laravel-lang
DOMAIN_NAME: laravel-lang.com
BUILDER_VERSION: 241.18775
jobs:
build:
name: Build application
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
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: Clone projects
run: composer clone
- name: Update Team
run: |
php src/team.php
- name: Download versions
run: |
php src/releases.php
- name: Move completion statuses
run: |
php src/statuses.php
php src/available.php
- name: Update examples
run: |
php src/native_names.php
- name: Build documentation
uses: JetBrains/writerside-github-action@v4
with:
instance: ${{ env.INSTANCE }}
artifact: ${{ env.ARTIFACT_DOCS }}
docker-version: ${{ env.BUILDER_VERSION }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: docs
path: |
artifacts/${{ env.ARTIFACT_DOCS }}
artifacts/report.json
retention-days: 7
- name: Upload search indexes
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_INDEXES }}
path: artifacts/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 7
test:
needs: build
name: Testing
runs-on: ubuntu-latest
steps:
- name: Download docs artifact
uses: actions/download-artifact@v4
with:
name: docs
path: artifacts
- name: Test documentation
uses: JetBrains/writerside-checker-action@v1
with:
instance: ${{ env.INSTANCE }}
cleanup_algolia:
needs: build
name: Cleaning up search indexes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: montudor/action-zip@v1
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
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: Download search artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_INDEXES }}
- name: Unzip artifact
run: unzip -qq ${{ env.ALGOLIA_ARTIFACT }} -d ${{ env.ARTIFACT_INDEXES }}
- name: Clean up
run: sudo php src/clean_algolia.php ${{ env.ARTIFACT_INDEXES }}
- name: Zip artifact
run: |
rm -f ${{ env.ALGOLIA_ARTIFACT }}
cd ${{ env.ARTIFACT_INDEXES }}
zip -qq -r ${{ env.ALGOLIA_ARTIFACT }} *
cd ..
- name: Update search indexes
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_INDEXES_CLEARED }}
path: ${{ env.ARTIFACT_INDEXES }}/${{ env.ALGOLIA_ARTIFACT }}
retention-days: 7
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
echo "Sitemap: https://${{ env.DOMAIN_NAME }}/sitemap.xml" >> robots.txt
- name: Upload artifacts
uses: actions/upload-artifact@v4
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@v4
with:
name: docs
- name: Download robots artifact
uses: actions/download-artifact@v4
with:
name: robots
- name: Unzip artifact
run: unzip -O UTF-8 -qq '${{ env.ARTIFACT_DOCS }}' -d dir
- name: Move robots
run: |
sudo mv robots.txt dir/robots.txt
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: dir
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
deploy-indexes:
environment: deploy
needs:
- test
- cleanup_algolia
name: Deploy to Algolia
runs-on: ubuntu-latest
timeout-minutes: 3
container:
image: registry.jetbrains.team/p/writerside/builder/algolia-publisher:2.0.32-3
steps:
- name: Download search artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_INDEXES_CLEARED }}
- name: Unzip artifact
run: unzip -O UTF-8 -qq '${{ env.ALGOLIA_ARTIFACT }}' -d ${{ env.ARTIFACT_INDEXES }}
- name: Deploy to Algolia
run: |
env algolia-key='${{ env.ALGOLIA_KEY }}' java -jar /opt/builder/help-publication-agent.jar \
update-index \
--application-name '${{ env.ALGOLIA_APP_NAME }}' \
--index-name '${{ env.ALGOLIA_INDEX_NAME }}' \
--product '${{ env.CONFIG_JSON_PRODUCT }}' \
--version '${{ env.CONFIG_JSON_VERSION }}' \
--index-directory ${{ env.ARTIFACT_INDEXES }}/ \
2>&1 | tee algolia-update-index-log.txt