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 | 345 | with: |
| 346 | 346 | path: docs/wiki/ |
| 347 | 347 | |
| 348 | - publish-docs: | |
| 348 | + build-docs: | |
| 349 | 349 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'niri-wm/niri' |
| 350 | 350 | needs: |
| 351 | 351 | - test |
| 352 | - permissions: | |
| 353 | - contents: write | |
| 354 | 352 | runs-on: ubuntu-24.04 |
| 355 | 353 | steps: |
| 356 | 354 | - uses: actions/checkout@v6 |
| @@ -376,14 +374,23 @@ jobs: | ||
| 376 | 374 | - name: Generate rustdoc documentation |
| 377 | 375 | run: cargo doc --no-deps -p niri-ipc |
| 378 | 376 | |
| 379 | - - run: mkdir -p publish/niri_ipc | |
| 380 | - - run: cp -r ./target/doc/* ./publish/ | |
| 381 | - - run: cp -r ./docs/site/* ./publish/ | |
| 377 | + - run: | | |
| 378 | + mkdir -p publish/niri_ipc | |
| 379 | + cp -r ./target/doc/* ./publish/ | |
| 380 | + cp -r ./docs/site/* ./publish/ | |
| 382 | 381 | |
| 383 | - - name: Deploy documentation | |
| 384 | - if: github.ref == 'refs/heads/main' | |
| 385 | - uses: peaceiris/actions-gh-pages@v4 | |
| 382 | + - name: Upload pages artifact | |
| 383 | + uses: actions/upload-pages-artifact@v5 | |
| 386 | 384 | with: |
| 387 | - github_token: ${{ secrets.GITHUB_TOKEN }} | |
| 388 | - publish_dir: ./publish | |
| 389 | - force_orphan: true | |
| 385 | + path: ./publish | |
| 386 | + | |
| 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 |