-
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (40 loc) · 1.11 KB
/
publish_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
name: Publish docs
on:
release:
types: [ created ]
workflow_dispatch:
inputs:
version:
type: string
description: Version number
required: true
jobs:
# Generate docs on GitHub pages
docs:
name: 'Generate docs'
runs-on: ubuntu-latest
steps:
# Checkout repository
- uses: actions/checkout@v3
# Setup Dart SDK
- uses: dart-lang/setup-dart@main
# Update version number
- name: Update version number
uses: jacobtomlinson/[email protected]
with:
find: "VERSIONADDEDBYGITHUB"
replace: "${{ github.event.inputs.version || github.ref_name }}"
regex: false
# Minimal package setup
- name: Install dependencies
run: dart pub get
working-directory: ${{ inputs.working-directory }}
# Generate docs
- name: Generate docs
run: dart doc
# Deploy docs to GitHub pages
- name: Deploy docs to GitHub pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: doc/api