-
Notifications
You must be signed in to change notification settings - Fork 2
51 lines (45 loc) · 1.44 KB
/
build_and_deploy_docs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deploy Docs
on:
push:
branches:
- 'master'
jobs:
main:
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deploy-docs.outputs.page_url }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [ 2.19.6 ]
steps:
- uses: actions/checkout@v3
- uses: dart-lang/setup-dart@v1
with:
sdk: ${{ matrix.sdk }}
- name: Print Dart SDK version
run: dart --version
- id: build-docs
name: Build Docs
run: dart pub get && dart doc .
if: ${{ matrix.sdk == '2.19.6' }}
# Upload the artifact as required by actions/deploy-pages
- name: Archive Dartdoc Artifact
id: archive-dartdoc-artifact
uses: actions/[email protected]
with:
name: dartdoc
path: doc/api/
if: ${{ steps.build-docs.outcome == 'success' }}
- id: deploy-docs
name: Deploy Docs 🚀
uses: actions/deploy-pages@v1
with:
artifact_name: dartdoc
if: ${{ steps.build-docs.outcome == 'success' && steps.archive-dartdoc-artifact.outcome == 'success' && github.event_name == 'push' }}