Deploy GitHub Pages #63
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy GitHub Pages | |
env: | |
gh_pages_index_prefix: | | |
<html> | |
<head> | |
<title>ICGE Documentation</title> | |
</head> | |
<body> | |
<h1>ICGE Documentation</h1> | |
<p> This is the documentation for the ICGE.</p> | |
<p> If you are looking for the code, see <a href="https://github.com/fius/icge2">github.com/fius/icge2</a></p> | |
<h2>Contents</h2> | |
<ul> | |
gh_pages_index_suffix: | | |
</ul> | |
</body> | |
</html> | |
on: | |
push: | |
branches: [ master ] | |
tags: [ '**' ] | |
release: | |
types: [ published, edited ] | |
workflow_dispatch: {} | |
jobs: | |
generate_javadoc: | |
name: Generate Javadoc | |
runs-on: ubuntu-latest | |
steps: | |
- name: Calculate ref | |
run: echo "REF_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Setup java | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- uses: actions/checkout@v2 | |
- name: Generate javadoc | |
run: ./mvnw -B javadoc:aggregate -pl '!ICGE-build-tools,!ICGE-ManualStart' | |
- name: Deploy | |
uses: peaceiris/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./target/site/apidocs/ | |
destination_dir: ./${{ env.REF_NAME }} | |
generate_index: | |
name: Generate Index | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: gh-pages | |
- name: Generate index | |
run: | | |
#!/usr/bin/env bash | |
echo "$gh_pages_index_prefix" > index.html | |
for path in * ;do | |
if [ -d $path ] ;then | |
echo '<li><a href="'"$path"'">'"$path"'</a></li>' >> index.html | |
fi | |
done | |
echo "$gh_pages_index_suffix" >> index.html | |
- name: Commit index | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update index |