Modernize GH pages workflow
Browse files at this commitf51d761c456d635084b2f117a9ccbe9b96ad5acaParent: 8319322- ci
- modernize GH pages workflow
1 changed file +19 -12
- .github/workflows/ci.yml +19 -12
.github/workflows/ci.ymlmodified+19 -12
| @@ -345,12 +345,10 @@ jobs: | |||
| 345 | with: | 345 | with: |
| 346 | path: docs/wiki/ | 346 | path: docs/wiki/ |
| 347 | 347 | ||
| 348 | - publish-docs: | 348 | + build-docs: |
| 349 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'niri-wm/niri' | 349 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'niri-wm/niri' |
| 350 | needs: | 350 | needs: |
| 351 | - test | 351 | - test |
| 352 | - permissions: | ||
| 353 | - contents: write | ||
| 354 | runs-on: ubuntu-24.04 | 352 | runs-on: ubuntu-24.04 |
| 355 | steps: | 353 | steps: |
| 356 | - uses: actions/checkout@v6 | 354 | - uses: actions/checkout@v6 |
| @@ -376,14 +374,23 @@ jobs: | |||
| 376 | - name: Generate rustdoc documentation | 374 | - name: Generate rustdoc documentation |
| 377 | run: cargo doc --no-deps -p niri-ipc | 375 | run: cargo doc --no-deps -p niri-ipc |
| 378 | 376 | ||
| 379 | - - run: mkdir -p publish/niri_ipc | 377 | + - run: | |
| 380 | - - run: cp -r ./target/doc/* ./publish/ | 378 | + mkdir -p publish/niri_ipc |
| 381 | - - run: cp -r ./docs/site/* ./publish/ | 379 | + cp -r ./target/doc/* ./publish/ |
| 380 | + cp -r ./docs/site/* ./publish/ | ||
| 382 | 381 | ||
| 383 | - - name: Deploy documentation | 382 | + - name: Upload pages artifact |
| 384 | - if: github.ref == 'refs/heads/main' | 383 | + uses: actions/upload-pages-artifact@v5 |
| 385 | - uses: peaceiris/actions-gh-pages@v4 | ||
| 386 | with: | 384 | with: |
| 387 | - github_token: ${{ secrets.GITHUB_TOKEN }} | 385 | + path: ./publish |
| 388 | - publish_dir: ./publish | 386 | + |
| 389 | - force_orphan: true | 387 | + publish-docs: |
| 388 | + runs-on: ubuntu-24.04 | ||
| 389 | + needs: | ||
| 390 | + - build-docs | ||
| 391 | + permissions: | ||
| 392 | + id-token: write | ||
| 393 | + pages: write | ||
| 394 | + steps: | ||
| 395 | + - name: Deploy artifact to GitHub Pages | ||
| 396 | + uses: actions/deploy-pages@v5 | ||