mirror of
https://github.com/CarmJos/EasySQL.git
synced 2024-09-19 21:35:47 +00:00
将Javadoc部署整合到Maven Deploy
This commit is contained in:
parent
6c08d265c5
commit
edadc50c22
52
.github/workflows/deploy.yml
vendored
52
.github/workflows/deploy.yml
vendored
@ -11,8 +11,7 @@ on:
|
|||||||
types: [ published ]
|
types: [ published ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
deploy:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -26,8 +25,55 @@ jobs:
|
|||||||
server-id: github
|
server-id: github
|
||||||
server-username: MAVEN_USERNAME
|
server-username: MAVEN_USERNAME
|
||||||
server-password: MAVEN_TOKEN
|
server-password: MAVEN_TOKEN
|
||||||
- name: "Deploy"
|
|
||||||
|
- name: "Maven Deploy With Javadoc"
|
||||||
run: mvn -B deploy --file pom.xml -DskipTests
|
run: mvn -B deploy --file pom.xml -DskipTests
|
||||||
env:
|
env:
|
||||||
MAVEN_USERNAME: ${{ github.repository_owner }}
|
MAVEN_USERNAME: ${{ github.repository_owner }}
|
||||||
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
MAVEN_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||||
|
|
||||||
|
- name: "Copy Javadoc to Location"
|
||||||
|
run: |
|
||||||
|
rm -rf docs
|
||||||
|
mkdir -vp docs
|
||||||
|
cp -vrf easysql-api/target/apidocs/* docs/
|
||||||
|
cp -vrf .documentation/JAVADOC-README.md docs/README.md
|
||||||
|
|
||||||
|
- name: "Generate the Javadoc sitemap"
|
||||||
|
id: sitemap
|
||||||
|
uses: cicirello/generate-sitemap@v1
|
||||||
|
with:
|
||||||
|
base-url-path: https://carmjos.github.io/EasySQL
|
||||||
|
path-to-root: docs
|
||||||
|
|
||||||
|
- 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 }}"
|
||||||
|
|
||||||
|
- name: "Configure Git"
|
||||||
|
env:
|
||||||
|
DEPLOY_PRI: ${{secrets.DEPLOY_PRI}}
|
||||||
|
run: |
|
||||||
|
sudo timedatectl set-timezone "Asia/Shanghai"
|
||||||
|
mkdir -p ~/.ssh/
|
||||||
|
echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
|
||||||
|
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'
|
||||||
|
|
||||||
|
- name: "Commit documentations"
|
||||||
|
run: |
|
||||||
|
cd docs
|
||||||
|
git init
|
||||||
|
git remote add origin git@github.com:CarmJos/EasySQL.git
|
||||||
|
git checkout -b gh-pages
|
||||||
|
git add -A
|
||||||
|
git commit -m "API Document generated."
|
||||||
|
|
||||||
|
- name: "Push javadocs"
|
||||||
|
run: |
|
||||||
|
cd docs
|
||||||
|
git push origin HEAD:gh-pages --force
|
||||||
|
73
.github/workflows/javadoc.yml
vendored
73
.github/workflows/javadoc.yml
vendored
@ -1,73 +0,0 @@
|
|||||||
# 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 Deployment"
|
|
||||||
|
|
||||||
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
|
|
||||||
run: mvn clean package -DskipTests
|
|
||||||
|
|
||||||
- name: Copy to Location
|
|
||||||
run: |
|
|
||||||
rm -rf docs
|
|
||||||
mkdir -vp docs
|
|
||||||
cp -vrf easysql-api/target/apidocs/* docs/
|
|
||||||
cp -vrf .documentation/JAVADOC-README.md docs/README.md
|
|
||||||
|
|
||||||
- name: Generate the sitemap
|
|
||||||
id: sitemap
|
|
||||||
uses: cicirello/generate-sitemap@v1
|
|
||||||
with:
|
|
||||||
base-url-path: https://carmjos.github.io/EasySQL
|
|
||||||
path-to-root: docs
|
|
||||||
|
|
||||||
- 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 }}"
|
|
||||||
|
|
||||||
- name: Configure Git
|
|
||||||
env:
|
|
||||||
DEPLOY_PRI: ${{secrets.DEPLOY_PRI}}
|
|
||||||
run: |
|
|
||||||
sudo timedatectl set-timezone "Asia/Shanghai"
|
|
||||||
mkdir -p ~/.ssh/
|
|
||||||
echo "$DEPLOY_PRI" > ~/.ssh/id_rsa
|
|
||||||
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'
|
|
||||||
|
|
||||||
- name: Commit documentation changes
|
|
||||||
run: |
|
|
||||||
cd docs
|
|
||||||
git init
|
|
||||||
git remote add origin git@github.com:CarmJos/EasySQL.git
|
|
||||||
git checkout -b gh-pages
|
|
||||||
git add -A
|
|
||||||
git commit -m "API Document generated."
|
|
||||||
- name: Push javadocs
|
|
||||||
run: |
|
|
||||||
cd docs
|
|
||||||
git push origin HEAD:gh-pages --force
|
|
||||||
|
|
2
.github/workflows/maven.yml
vendored
2
.github/workflows/maven.yml
vendored
@ -1,7 +1,7 @@
|
|||||||
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
|
# 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
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
|
||||||
|
|
||||||
name: Build
|
name: Project Build & Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# 支持手动触发构建
|
# 支持手动触发构建
|
||||||
|
Loading…
Reference in New Issue
Block a user