github action yaml updated #40
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: Java CI with Maven, WireMock, Javadoc and GitHub Packages Deployment | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
POM_FILE: pom.xml | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
OWNER: ${{ secrets.OWNER }} | |
REPOSITORY: ${{ secrets.REPOSITORY }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: maven | |
- name: Set up environment variables | |
run: echo "env=ci" >> $GITHUB_ENV | |
- name: Set up environment variables | |
run: echo "GPG_KEY_NAME=${{ secrets.GPG_KEY_NAME }}" >> $GITHUB_ENV | |
- name: Set up environment variables | |
run: echo "GPG_PASSPHRASE=${{ secrets.GPG_PASSPHRASE }}" >> $GITHUB_ENV | |
- name: Set up environment variables | |
run: echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> $GITHUB_ENV | |
- name: Build with Maven | |
run: mvn -B package --file ${{ env.POM_FILE }} | |
- name: Update dependency graph | |
uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 | |
- name: Deploy to GitHub Packages | |
run: | | |
mvn -B deploy -DrepositoryId=github -Durl=https://maven.pkg.github.com/${{ env.OWNER }}/${{ env.REPOSITORY }} | |
- name: Generate Javadoc | |
run: mvn javadoc:jar | |
- name: Deploy Javadoc to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ env.GITHUB_TOKEN }} | |
publish_branch: gh-pages | |
publish_dir: ./target/site/apidocs | |
# publish_dir: ./target/site/apidocs/ | |
force_orphan: true | |
- name: Set up environment variables | |
run: echo "GEMINI_API_KEY=${{ secrets.GEMINI_API_KEY }}" >> $GITHUB_ENV |