From 5dc4703ee56e1240d899623965aca6089dafea91 Mon Sep 17 00:00:00 2001 From: xooooooooox Date: Thu, 2 Jan 2025 22:33:49 +0800 Subject: [PATCH] chore: optimize gh actions --- .github/actions/writerside/action.yml | 123 -------------------------- 1 file changed, 123 deletions(-) delete mode 100644 .github/actions/writerside/action.yml diff --git a/.github/actions/writerside/action.yml b/.github/actions/writerside/action.yml deleted file mode 100644 index e954ef2..0000000 --- a/.github/actions/writerside/action.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: 'Build and publish Writerside GitHub Pages' - -# This workflow can be reused by other workflows -on: - workflow_call: - inputs: - instance: - description: 'Instance identifier (e.g., Writerside/hi)' - required: true - type: string - docker_version: - description: 'Docker version to use' - required: false - default: '243.22562' - branches: - description: 'Branches to trigger on push' - required: false - type: array - default: ['main'] - paths: - description: 'Paths to watch for changes' - required: false - type: array - default: ['Writerside/*'] - -permissions: - contents: read - id-token: write - pages: write - -env: - INSTANCE: ${{ inputs.instance }} - DOCKER_VERSION: ${{ inputs.docker_version }} - -jobs: - build: - runs-on: ubuntu-latest - outputs: - algolia_artifact: ${{ steps.define-ids.outputs.algolia_artifact }} - artifact: ${{ steps.define-ids.outputs.artifact }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Define instance id and artifacts - id: define-ids - run: | - INSTANCE=${INSTANCE#*/} - INSTANCE_ID_UPPER=$(echo "$INSTANCE" | tr '[:lower:]' '[:upper:]') - ARTIFACT="webHelp${INSTANCE_ID_UPPER}2-all.zip" - ALGOLIA_ARTIFACT="algolia-indexes-${INSTANCE_ID_UPPER}.zip" - - # Print the values - echo "INSTANCE_ID_UPPER: $INSTANCE_ID_UPPER" - echo "ARTIFACT: $ARTIFACT" - echo "ALGOLIA_ARTIFACT: $ALGOLIA_ARTIFACT" - - # Set the outputs - echo "artifact=$ARTIFACT" >> $GITHUB_OUTPUT - echo "algolia_artifact=$ALGOLIA_ARTIFACT" >> $GITHUB_OUTPUT - - - name: Build docs using Writerside Docker builder - uses: JetBrains/writerside-github-action@v4 - with: - instance: ${{ env.INSTANCE }} - artifact: ${{ steps.define-ids.outputs.artifact }} - docker-version: ${{ env.DOCKER_VERSION }} - - - name: Save artifact with build results - uses: actions/upload-artifact@v4 - with: - name: docs - path: | - artifacts/${{ steps.define-ids.outputs.artifact }} - artifacts/report.json - artifacts/${{ steps.define-ids.outputs.algolia_artifact }} - retention-days: 7 - - test: - needs: build - runs-on: ubuntu-latest - steps: - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: docs - path: artifacts - - - name: Test documentation - uses: JetBrains/writerside-checker-action@v1 - with: - instance: ${{ inputs.instance }} - - deploy: - needs: [build, test] - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Download artifacts - uses: actions/download-artifact@v4 - with: - name: docs - path: artifacts - - - name: Unzip artifact - run: unzip -O UTF-8 -qq "artifacts/${{ needs.build.outputs.artifact }}" -d dir - - - name: Setup Pages - uses: actions/configure-pages@v4 - - - name: Package and upload Pages artifact - uses: actions/upload-pages-artifact@v3 - with: - path: dir - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 -