Skip to content

Commit

Permalink
Generates GitPages on released (#10)
Browse files Browse the repository at this point in the history
* Generates GitPages automatically
  • Loading branch information
Hirotaka Wakabayashi authored Feb 3, 2020
1 parent 3562042 commit 037ad0c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
if: github.event_name == 'release'
run: mvn -B exec:exec --file pom.xml -Pupload

- name: Deploy the docs to github
env:
GITPAGES_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKE_FOR_GITPAGES }}
if: github.event_name == 'release'
run: mvn -B site --file pom.xml -s settings.xml
8 changes: 7 additions & 1 deletion .github/workflows/upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ set -u
umask 022

# environments
REPOSITORY_PATH=yahoojapan/k2hdkc_java
REPOSITORY_PATH=${GITHUB_REPOSITORY}
SRCDIR=$(cd $(dirname "$0") && pwd)
DEBUG=1
if test "${DEBUG}" -eq 1; then
Expand All @@ -57,6 +57,12 @@ if test -z "${GITHUB_TOKEN}"; then
logger -t ${TAG} -p user.error "No GITHUB_TOKEN variable defined."
exit 1
fi
# GITHUB_REPOSITORY should be defined.
# https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-environment-variables
if test -z "${GITHUB_REPOSITORY}"; then
logger -t ${TAG} -p user.error "No GITHUB_REPOSITORY variable defined."
exit 1
fi

# API SPEC
# https://developer.github.com/v3/repos/releases/#get-the-latest-release
Expand Down
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
k2hdkc-java (1.1.6) stable; urgency=low

* Generates GitPages on released

-- Hirotaka Wakabayashi <[email protected]> Mon, 03 Feb 2020 00:36:37 +0000

k2hdkc-java (1.1.5) stable; urgency=low

* Uploads a pom file to assets

-- Hirotaka Wakabayashi <[email protected]> Fri, 31 Jan 2020 05:12:06 +0000

k2hdkc-java (1.1.4) stable; urgency=low

* Fixes the wrong GitHub release API endpoint.
Expand Down
19 changes: 18 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<artifactId>k2hdkc</artifactId>
<packaging>jar</packaging>

<version>1.1.5</version>
<version>1.1.6</version>
<name>k2hdkc</name>
<description>An official java driver for k2hdkc, which is a highly available and scalable distributed KVS clustering system.</description>
<url>https://github.com/yahoojapan/k2hdkc_java</url>
Expand Down Expand Up @@ -187,6 +187,23 @@
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.github.github</groupId>
<artifactId>site-maven-plugin</artifactId>
<version>${site-maven-plugin.version}</version>
<configuration>
<dryRun>false</dryRun>
<message>Creating site for ${project.version}</message>
</configuration>
<executions>
<execution>
<goals>
<goal>site</goal>
</goals>
<phase>site</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down
3 changes: 1 addition & 2 deletions settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
<servers>
<server>
<id>github</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_PASSWORD}</password>
<password>${env.GITPAGES_TOKEN}</password>
</server>
</servers>
</settings>

0 comments on commit 037ad0c

Please sign in to comment.