-
Notifications
You must be signed in to change notification settings - Fork 4
93 lines (80 loc) · 2.29 KB
/
dartdoc-gh-pages.yml
File metadata and controls
93 lines (80 loc) · 2.29 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Deploy Dartdoc with GitHub Pages dependencies preinstalled
on:
push:
branches:
- main
- develop
workflow_dispatch:
permissions:
contents: write
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: stable
- name: Setup environment
uses: ./.github/actions/setup
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3.5
- name: Build with Dartdoc
run: |
cd ouds_core
dart pub get
dart doc .
- name: Move DartDoc output
run: |
mkdir -p ./docs
mv ouds_core/doc/api/* ./docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: github-pages
- name: List files in current directory (to verify artifact)
run: |
ls -la
- name: Create docs directory if not exists
run: |
mkdir -p ./docs
- name: Extract artifact into docs directory
run: |
tar -xvf artifact.tar -C ./docs
ls -la ./docs
- name: Commit changes and push to gh-pages
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git checkout gh-pages || git checkout -b gh-pages
git rm -rf .
echo "flutter.unified-design-system.orange.com" > docs/CNAME
git add ./docs/*
commit_message="doc: deploy site to GitHub Pages - Version $(date +%Y%m%d)"
git commit -m "$commit_message" || echo "No changes to commit"
git push origin gh-pages --force
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}