| name: Deploy to GitHub Pages |
| |
| on: |
| push: |
| branches: |
| - main |
| |
| # Declare default permissions as read only. |
| permissions: read-all |
| |
| jobs: |
| build-and-deploy-docs: |
| permissions: |
| contents: write |
| runs-on: ubuntu-latest |
| if: github.repository == 'dart-lang/linter' |
| |
| steps: |
| - name: Checkout repository |
| uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 |
| - name: Setup Dart |
| uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d |
| with: |
| sdk: stable |
| - name: Get dependencies |
| run: dart pub get |
| - name: Generate docs |
| run: dart run tool/doc.dart --create-dirs --no-markdown --out lints --token ${{ secrets.GITHUB_TOKEN }} |
| - name: Deploy docs |
| uses: peaceiris/actions-gh-pages@de7ea6f8efb354206b205ef54722213d99067935 |
| with: |
| github_token: ${{ secrets.GITHUB_TOKEN }} |
| publish_branch: gh-pages |
| publish_dir: lints |
| destination_dir: lints |
| keep_files: true |