Skip to content

Commit

Permalink
deploy GH pages via GH action
Browse files Browse the repository at this point in the history
  • Loading branch information
kwin committed Oct 10, 2024
1 parent 00fbdfa commit e00daf2
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
30 changes: 27 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git Clone
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -42,6 +42,30 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# Needed to get some information about the pull request, if any
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Deploy Site for Maven Plugin
- name: Build Site for Maven Plugin
if: github.ref == 'refs/heads/master'
run: mvn -B clean site --file aem-classification-maven-plugin/pom.xml
- name: Upload Site for Maven Plugin
if: github.ref == 'refs/heads/master'
run: mvn -B clean site site:stage scm-publish:publish-scm -Dusername=kwin -Dpassword=${{ secrets.GH_PAGES_BRANCH_TOKEN_KWIN }} --file aem-classification-maven-plugin/pom.xml
uses: actions/upload-pages-artifact@v3
with:
path: aem-classification-maven-plugin/target/site/
deploy:
# Add a dependency to the build job
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
12 changes: 0 additions & 12 deletions aem-classification-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,6 @@
</properties>

<build>
<!-- https://blog.soebes.de/blog/2015/06/12/making-github-page-for-mojohaus/ -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-scm-publish-plugin</artifactId>
<configuration>
<scmBranch>gh-pages</scmBranch>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-site-plugin</artifactId>
Expand Down

0 comments on commit e00daf2

Please sign in to comment.