|
| 1 | +name: Build Japanese and Korean Documentation |
| 2 | + |
| 3 | +permissions: |
| 4 | + contents: write |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - vnext |
| 10 | + - master |
| 11 | + paths-ignore: |
| 12 | + - '**/en/**' |
| 13 | + workflow_dispatch: |
| 14 | + inputs: |
| 15 | + branch: |
| 16 | + description: 'Branch to checkout' |
| 17 | + type: string |
| 18 | + default: '' |
| 19 | + isVerbose: |
| 20 | + description: 'Get verbose output from steps - where configurable' |
| 21 | + type: boolean |
| 22 | + default: false |
| 23 | + shouldCleanPostExecution: |
| 24 | + description: 'Clean all pipeline dirs after the pipeline finishes?' |
| 25 | + type: boolean |
| 26 | + default: true |
| 27 | + |
| 28 | +env: |
| 29 | + BUILD_TYPE: ${{ github.ref_name == 'master' && 'production' || 'staging' }} |
| 30 | + TARGET_REF: ${{ github.event.inputs.branch && (startsWith(github.event.inputs.branch, 'refs/') && github.event.inputs.branch || format('refs/heads/{0}', github.event.inputs.branch)) || github.ref }} |
| 31 | + |
| 32 | +jobs: |
| 33 | + build: |
| 34 | + name: Build Job |
| 35 | + runs-on: ubuntu-latest |
| 36 | + |
| 37 | + steps: |
| 38 | + - name: Checkout repository |
| 39 | + uses: actions/checkout@v4 |
| 40 | + with: |
| 41 | + ref: ${{ env.TARGET_REF }} |
| 42 | + clean: true |
| 43 | + fetch-tags: true |
| 44 | + fetch-depth: 0 |
| 45 | + |
| 46 | + - name: Setup Node.js 20.x |
| 47 | + uses: actions/setup-node@v4 |
| 48 | + with: |
| 49 | + node-version: '20.x' |
| 50 | + |
| 51 | + - name: Setup .NET Core SDK 6.x |
| 52 | + uses: actions/setup-dotnet@v4 |
| 53 | + with: |
| 54 | + dotnet-version: '6.x' |
| 55 | + |
| 56 | + - name: Install dependencies |
| 57 | + run: npm ci --production=false ${{ github.event.inputs.isVerbose == 'true' && '--verbose' || '' }} |
| 58 | + |
| 59 | + - name: Build Japanese documentation |
| 60 | + run: npm run build-${{ env.BUILD_TYPE }} -- --lang=jp ${{ github.event.inputs.isVerbose == 'true' && '--verbose' || '' }} |
| 61 | + |
| 62 | + - name: Package Japanese build |
| 63 | + run: | |
| 64 | + cd jp/_site |
| 65 | + zip -r ../../${{ env.BUILD_TYPE }}_jp.zip . |
| 66 | + cd ../.. |
| 67 | +
|
| 68 | + - name: Build Korean documentation |
| 69 | + run: npm run build-${{ env.BUILD_TYPE }} -- --lang=kr ${{ github.event.inputs.isVerbose == 'true' && '--verbose' || '' }} |
| 70 | + |
| 71 | + - name: Package Korean build |
| 72 | + run: | |
| 73 | + cd kr/_site |
| 74 | + zip -r ../../${{ env.BUILD_TYPE }}_kr.zip . |
| 75 | + cd ../.. |
| 76 | +
|
| 77 | + - name: Upload artifacts |
| 78 | + uses: actions/upload-artifact@v4 |
| 79 | + with: |
| 80 | + name: IgniteUIDocFX-jp-kr |
| 81 | + path: | |
| 82 | + ${{ env.BUILD_TYPE }}_jp.zip |
| 83 | +# ${{ env.BUILD_TYPE }}_kr.zip |
| 84 | + retention-days: 1 |
| 85 | + |
| 86 | + - name: Clean workspace |
| 87 | + if: ${{ github.event.inputs.shouldCleanPostExecution == 'true' || github.event_name == 'push' }} |
| 88 | + run: | |
| 89 | + git clean -ffdx |
| 90 | + git reset --hard |
| 91 | +
|
| 92 | + - name: Trigger Deploy Workflow in IgniteUI Actions |
| 93 | + uses: actions/github-script@v8 |
| 94 | + with: |
| 95 | + github-token: ${{ secrets.CLASSIC_PAT_GITHUB }} |
| 96 | + script: | |
| 97 | + await github.rest.repos.createDispatchEvent({ |
| 98 | + owner: 'IgniteUI', |
| 99 | + repo: 'igniteui-actions', |
| 100 | + event_type: 'igniteui-docfx-cd', |
| 101 | + client_payload: { |
| 102 | + calling_branch: "${{ env.TARGET_REF }}", |
| 103 | + repository: "${{ github.repository }}", |
| 104 | + run_id: "${{ github.run_id }}", |
| 105 | + artifact_name: "IgniteUIDocFX-jp-kr", |
| 106 | + base_href: "angular-samples", |
| 107 | + platform: "angular", |
| 108 | + locale: "jp", |
| 109 | + ref: "${{ github.ref }}", |
| 110 | + sha: "${{ github.sha }}", |
| 111 | + branch: '${{ github.ref_name }}', |
| 112 | + } |
| 113 | + }); |
0 commit comments