Skip to content

Commit 629e417

Browse files
committed
fix: deploy javadocs to gh-pages on commit to master
1 parent 81edd0d commit 629e417

File tree

3 files changed

+30
-5
lines changed

3 files changed

+30
-5
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,13 @@ jobs:
4040
success()
4141
&& github.repository_owner == 'jsonurl'
4242
&& github.ref == 'refs/heads/master'
43-
# '-Dscmpublish.dryRun=true'
4443
run: >
45-
mvn '-Dscmpublish.checkinComment=doc: Update by action ${{ github.workflow }}.${{ github.job }}/${{ github.run_id }} on behalf of ${{ github.actor }} for ${{ github.event_name }} ${{ github.sha }}'
46-
'-Dscmpublish.pubScmUrl=scm:git:https://github.com/${{ github.repository }}.git'
47-
-B -Ppublish-javadoc-site javadoc:aggregate scm-publish:publish-scm
44+
script/deploy_ghpages.sh
45+
'doc: Update by action ${{ github.workflow }}.${{ github.job }}/${{ github.run_id }} on behalf of ${{ github.actor }} for ${{ github.event_name }} ${{ github.sha }}'
46+
'scm:git:https://github.com/${{ github.repository }}.git'
47+
shell: bash
48+
env:
49+
GH_ACTION_KEY: ${{ secrets.GH_ACTION_KEY }}
4850

4951
matrix-build:
5052
needs: artifact

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
<scmBranch>gh-pages</scmBranch>
9191
<content>${project.reporting.outputDirectory}/apidocs</content>
9292
<checkinComment>doc: update by maven-scm-publish-plugin</checkinComment>
93-
<serverId>github</serverId>
93+
<!-- <serverId>github</serverId> -->
9494
<ignorePathsToDelete>
9595
<ignorePathsToDelete>.gitignore</ignorePathsToDelete>
9696
<ignorePathsToDelete>.gitattributes</ignorePathsToDelete>

script/deploy_ghpages.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
comment="$1"
4+
url="$2"
5+
6+
git config --global user.email "$GITHUB_ACTOR"
7+
git config --global user.name "ci action"
8+
9+
mkdir -p ~/.ssh
10+
chmod 700 ~/.ssh
11+
cat >~/.ssh/id_ed25519 << EOT
12+
-----BEGIN OPENSSH PRIVATE KEY-----
13+
$GH_ACTION_KEY
14+
-----END OPENSSH PRIVATE KEY-----
15+
EOT
16+
chmod 600 ~/.ssh/id_ed25519
17+
18+
# "-Dscmpublish.pubScmUrl=$url" \
19+
# '-Dscmpublish.dryRun=true' \
20+
# "-Dusername=git" \
21+
# "-Dpassword=$GITHUB_TOKEN" \
22+
exec mvn "-Dscmpublish.checkinComment=$comment" \
23+
-B -Ppublish-javadoc-site javadoc:aggregate scm-publish:publish-scm

0 commit comments

Comments
 (0)