|
17 | 17 |
|
18 | 18 | # Gives the workflow permissions to clone the repo and create a page deployment |
19 | 19 | permissions: |
20 | | - id-token: write |
| 20 | + contents: read |
21 | 21 | pages: write |
| 22 | + id-token: write |
22 | 23 |
|
23 | | -env: |
24 | | - # Name of module and id separated by a slash |
25 | | - INSTANCE: docs/docs |
26 | | - INSTANCE_NAME: docs |
27 | | - IS_GROUP: true |
28 | | - # Replace HI with the ID of the instance in capital letters |
29 | | - ARTIFACT: webHelpDOCS2-all.zip |
30 | | - # Writerside docker image version |
31 | | - # see https://www.jetbrains.com/help/writerside/deploy-docs-to-github-pages.html |
32 | | - DOCKER_VERSION: '2025048412' |
| 24 | +# Allow only one concurrent deployment |
| 25 | +concurrency: |
| 26 | + group: "pages" |
| 27 | + cancel-in-progress: false |
33 | 28 |
|
34 | 29 | jobs: |
35 | 30 | build: |
36 | 31 | runs-on: ubuntu-latest |
37 | | - outputs: |
38 | | - config_json: ${{ steps.output-config-json.outputs.config_json }} |
39 | | - |
| 32 | + defaults: |
| 33 | + run: |
| 34 | +working-directory: ./docs |
40 | 35 | steps: |
41 | 36 | - name: Checkout repository |
42 | 37 | uses: actions/checkout@v4 |
43 | | - |
44 | | - - name: Build Writerside docs using Docker |
45 | | - uses: JetBrains/writerside-github-action@v4 |
46 | | - with: |
47 | | - instance: ${{ env.INSTANCE }} |
48 | | - artifact: ${{ env.ARTIFACT }} |
49 | | - docker-version: ${{ env.DOCKER_VERSION }} |
50 | | - is-group: ${{ env.IS_GROUP }} |
51 | | - |
52 | | - - name: Upload documentation |
53 | | - uses: actions/upload-artifact@v4 |
54 | 38 | with: |
55 | | - name: docs |
56 | | - path: | |
57 | | - artifacts/${{ env.ARTIFACT }} |
58 | | - artifacts/report.json |
59 | | - retention-days: 7 |
| 39 | + fetch-depth: 0 |
60 | 40 |
|
61 | | - - name: Upload documentation test reports |
62 | | - uses: actions/upload-artifact@v4 |
63 | | - if: ${{ always() }} |
| 41 | + - name: Setup Node.js |
| 42 | + uses: actions/setup-node@v4 |
64 | 43 | with: |
65 | | - name: 'report.json' |
66 | | - path: | |
67 | | - artifacts/report.json |
68 | | - retention-days: 7 |
| 44 | + node-version: '18' |
| 45 | + cache: 'npm' |
| 46 | + cache-dependency-path: './docs/package-lock.json' |
69 | 47 |
|
70 | | - - name: Unzip artifact |
71 | | - run: unzip -O UTF-8 -qq artifacts/${{ env.ARTIFACT }} -d dir |
| 48 | + - name: Install dependencies |
| 49 | + run: npm ci |
72 | 50 |
|
73 | | - - name: Output documentation config.json |
74 | | - id: output-config-json |
75 | | - run: | |
76 | | - echo "config_json=$(cat dir/config.json)" >> $GITHUB_OUTPUT |
77 | | - |
78 | | - # Add the job below and artifacts/report.json on Upload documentation step above if you want to fail the build when documentation contains errors |
79 | | - test: |
80 | | - # Requires build job results |
81 | | - needs: build |
82 | | - runs-on: ubuntu-latest |
83 | | - |
84 | | - steps: |
85 | | - - name: Download artifacts |
86 | | - uses: actions/download-artifact@v4 |
87 | | - with: |
88 | | - name: docs |
89 | | - path: artifacts |
| 51 | + - name: Build Docusaurus site |
| 52 | + run: npm run build |
90 | 53 |
|
91 | | - - name: Test documentation |
92 | | - uses: JetBrains/writerside-checker-action@v1 |
| 54 | + - name: Upload artifact |
| 55 | + uses: actions/upload-pages-artifact@v3 |
93 | 56 | with: |
94 | | - instance: ${{ env.INSTANCE }} |
95 | | - is-group: ${{ env.IS_GROUP }} |
| 57 | + path: ./docs/build |
96 | 58 |
|
97 | 59 | deploy: |
98 | 60 | environment: |
99 | 61 | name: github-pages |
100 | 62 | url: ${{ steps.deployment.outputs.page_url }} |
101 | | - # Requires the build job results |
102 | | - needs: test |
| 63 | + needs: build |
103 | 64 | runs-on: ubuntu-latest |
104 | 65 | steps: |
105 | | - - name: Download artifact |
106 | | - uses: actions/download-artifact@v4 |
107 | | - with: |
108 | | - name: docs |
109 | | - path: artifacts |
110 | | - |
111 | | - - name: Unzip artifact |
112 | | - run: unzip -O UTF-8 -qq artifacts/${{ env.ARTIFACT }} -d dir |
113 | | - |
114 | | - - name: Setup Pages |
115 | | - uses: actions/configure-pages@v5 |
116 | | - |
117 | | - - name: Upload artifact |
118 | | - uses: actions/upload-pages-artifact@v3 |
119 | | - with: |
120 | | - path: dir |
121 | | - |
122 | 66 | - name: Deploy to GitHub Pages |
123 | 67 | id: deployment |
124 | 68 | uses: actions/deploy-pages@v4 |
0 commit comments