From e00daf2e27251e85625f39cc1de0ee56b80a5fed Mon Sep 17 00:00:00 2001 From: Konrad Windszus Date: Thu, 10 Oct 2024 08:53:19 +0200 Subject: [PATCH] deploy GH pages via GH action --- .github/workflows/maven.yml | 30 ++++++++++++++++++++++--- aem-classification-maven-plugin/pom.xml | 12 ---------- 2 files changed, 27 insertions(+), 15 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index d420926..784a390 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -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: @@ -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 \ No newline at end of file diff --git a/aem-classification-maven-plugin/pom.xml b/aem-classification-maven-plugin/pom.xml index 024b2b7..788f85f 100644 --- a/aem-classification-maven-plugin/pom.xml +++ b/aem-classification-maven-plugin/pom.xml @@ -30,18 +30,6 @@ - - - - - org.apache.maven.plugins - maven-scm-publish-plugin - - gh-pages - - - - maven-site-plugin