This repository was archived by the owner on Jan 28, 2026. It is now read-only.
Update deploy.yml #17
This file contains hidden or 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: 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-PACKAGE-WIZARD.zip | |
| ALGOLIA_INDEX_NAME: docs | |
| ALGOLIA_KEY: ${{ secrets.ALGOLIA_KEY }} | |
| ARTIFACT_DOCS: webHelpPACKAGE-WIZARD2-all.zip | |
| ARTIFACT_INDEXES: search-indexes | |
| ARTIFACT_INDEXES_CLEARED: search-indexes-cleared | |
| CONFIG_JSON_PRODUCT: package-wizard | |
| CONFIG_JSON_VERSION: main | |
| INSTANCE: docs/package-wizard | |
| DOMAIN_NAME: package-wizard.com | |
| BUILDER_VERSION: 2025.03.8312 | |
| 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: 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 }} | |
| 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 | |
| schemas: | |
| needs: build | |
| name: Download schemas | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Install jq | |
| run: sudo apt install jq | |
| #- name: Get latest version | |
| # id: versions | |
| # run: | | |
| # VERSION=$(curl -s https://repo.packagist.org/p2/package-wizard/installer.json | jq '.packages."package-wizard/installer"[0].version') | |
| # echo "VERSION: $VERSION" | |
| # | |
| # echo "latest=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Download schemas | |
| run: | | |
| # VERSION=${{ steps.versions.outputs.latest }} | |
| # update after release | |
| #curl -O https://raw.githubusercontent.com/package-wizard/installer/refs/tags/$VERSION/resources/schemas/schema-v2.json | |
| #curl -O https://raw.githubusercontent.com/package-wizard/installer/refs/tags/$VERSION/resources/schemas/example-v2.json | |
| curl -O https://raw.githubusercontent.com/package-wizard/installer/refs/heads/main/resources/schemas/schema-v2.json | |
| curl -O https://raw.githubusercontent.com/package-wizard/installer/refs/heads/main/resources/schemas/example-v2.json | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: schemas | |
| path: | | |
| schema-v2.json | |
| example-v2.json | |
| retention-days: 1 | |
| deploy-pages: | |
| environment: | |
| name: deploy | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| needs: | |
| - test | |
| - robots | |
| - schemas | |
| 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: Download schemas artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: schemas | |
| - 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: Move schema | |
| run: | | |
| mkdir dir/schemas | |
| mv schema-v2.json dir/schemas/schema-v2.json | |
| mv example-v2.json dir/schemas/example-v2.json | |
| - 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 | |
| # | |
| # 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 |