-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (34 loc) · 1.24 KB
/
docs.yaml
File metadata and controls
41 lines (34 loc) · 1.24 KB
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
name: CI/Docs
on:
push:
branches:
- main
jobs:
generate-docs:
name: 📚 Generate Documentation
runs-on: ubuntu-latest
steps:
- name: 📂 Checkout code
uses: actions/checkout@v3
- name: 🐦 Set up Flutter
uses: flutter-actions/setup-flutter@v3.6
with:
channel: stable
version: latest
- name: 📦 Install dependencies
run: flutter pub get
- name: 📝 Generate documentation
run: dart doc
- name: 🚀 Deploy to docs branch
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git clone --branch docs https://github.com/${{ github.repository }} docs-folder || (
mkdir docs-folder && cd docs-folder && git init && git remote add origin https://github.com/${{ github.repository }} && git checkout --orphan docs
)
rm -rf docs-folder/*
cp -r doc/api/* docs-folder/
cd docs-folder
git add .
git diff --cached --quiet || git commit -m "docs: generate documentation for ${{github.sha}}"
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} docs --force