1
mirror of https://github.com/CarmJos/UserPrefix.git synced 2024-09-20 04:25:46 +00:00
UserPrefix/.github/workflows/javadoc.yml

84 lines
2.4 KiB
YAML
Raw Normal View History

2021-11-22 18:46:51 +00:00
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
name: Javadoc
on:
# 支持手动触发构建
workflow_dispatch:
release:
# 创建release的时候触发
types: [ published ]
jobs:
api-website:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v2
- name: Set up the Java JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
- name: Generate docs
2021-11-22 20:16:59 +00:00
run: mvn package -DskipTests
2021-11-22 18:46:51 +00:00
- name: Copy to Location
run: |
rm -rf docs
2021-11-22 20:19:38 +00:00
cp -vrf target/apidocs/. docs
2021-11-22 20:05:49 +00:00
cp -vrf JAVADOC-README.md docs/README.md
2021-11-22 18:46:51 +00:00
2021-11-22 20:20:37 +00:00
# - name: Tidy up
# id: tidy
# uses: cicirello/javadoc-cleanup@v1
# with:
# base-url-path: https://carmjos.github.io/userprefix
# path-to-root: ""
#
# - name: Log output
# run: |
# echo "modified-count = ${{ steps.tidy.outputs.modified-count }}"
2021-11-22 18:46:51 +00:00
2021-11-22 18:56:11 +00:00
- name: Generate the sitemap
id: sitemap
uses: cicirello/generate-sitemap@v1
with:
base-url-path: https://carmjos.github.io/userprefix
2021-11-22 20:20:37 +00:00
path-to-root: ""
2021-11-22 18:46:51 +00:00
- name: Output stats
run: |
echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}"
echo "url-count = ${{ steps.sitemap.outputs.url-count }}"
echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}"
2021-11-22 19:34:03 +00:00
- name: Configure Git
env:
DEPLOY_PRI: ${{secrets.DEPLOY_PRI}}
run: |
sudo timedatectl set-timezone "Asia/Shanghai"
mkdir -p ~/.ssh/
2021-11-22 19:38:26 +00:00
echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
2021-11-22 19:34:03 +00:00
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name 'CarmJos'
git config --global user.email 'carm@carm.cc'
2021-11-22 18:56:11 +00:00
- name: Commit documentation changes
run: |
cd docs
git init
2021-11-22 19:34:03 +00:00
git remote add origin git@github.com:CarmJos/UserPrefix.git
2021-11-22 18:58:03 +00:00
git checkout -b gh-pages
2021-11-22 18:56:11 +00:00
git add -A
git commit -m "API Document generated."
2021-11-22 19:38:26 +00:00
- name: Push javadocs
run: |
2021-11-22 19:58:49 +00:00
cd docs
2021-11-22 19:45:31 +00:00
git push origin HEAD:gh-pages --force
2021-11-22 18:56:11 +00:00