66 paths :
77 - ' docs/**'
88 - ' mkdocs.yml'
9- - ' CHANGELOG.md'
9+ - ' packages/async-storage/ CHANGELOG.md'
1010 workflow_dispatch :
1111jobs :
1212 deploy-docs :
@@ -18,25 +18,27 @@ jobs:
1818 - uses : actions/setup-python@v6
1919 with :
2020 python-version : 3.11
21- - name : Install MkDocs
22- run : pip install --no-deps -r .github/requirements.txt
23- - name : Copy changelog
21+ - name : Read docs version
22+ id : version
2423 run : |
25- cp packages/async-storage/CHANGELOG.md docs/changelog.md
24+ VERSION_DOCS=$(node -p "require('./package.json').versionDocs || ''")
25+ echo "versionDocs=$VERSION_DOCS" >> $GITHUB_OUTPUT
26+ - name : Prepare MkDocs
27+ run : |
28+ pip install --no-deps -r .github/requirements.txt
29+ .github/scripts/prepare-mkdocs.sh
30+ # required for mike
2631 - name : Setup git user
2732 run : ./setup-ci-git-user.sh
28- working-directory : ./. github/scripts
33+ working-directory : .github/scripts
2934 env :
3035 GITHUB_TOKEN : ${{ secrets.GH_RELEASE_TOKEN }}
3136 GITHUB_NAME : ${{ vars.GH_BOT_NAME }}
3237 GITHUB_EMAIL : ${{ vars.GH_BOT_EMAIL }}
3338 GIT_SET_GLOBAL_USER : true
34- - name : Build docs
35- run : mkdocs build
36- - name : Deploy docs
37- uses : JamesIves/github-pages-deploy-action@v4
38- with :
39- folder : site
40- token : ${{ secrets.GH_BOT_TOKEN }}
41- git-config-name : ${{ vars.GH_BOT_NAME }}
42- git-config-email : ${{ vars.GH_BOT_EMAIL }}
39+ # required for mike
40+ - name : Setup gh-pages remote
41+ run : |
42+ git remote add docs https://github.com/react-native-async-storage/react-native-async-storage.github.io.git
43+ - name : Deploy Docs with mike
44+ run : mike deploy -u -r docs --push ${{ steps.version.outputs.versionDocs }} latest
0 commit comments