|
| 1 | +# Deploy snapshots to Sonatpe OSS repository and deploy site to GitHub Pages |
| 2 | + |
| 3 | +name: Deploy |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: |
| 8 | + - develop |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + |
| 14 | + runs-on: ubuntu-latest |
| 15 | + |
| 16 | + steps: |
| 17 | + # Check out Git repository |
| 18 | + - name: Checkout code |
| 19 | + uses: actions/checkout@v2 |
| 20 | + |
| 21 | + # Configure GIT |
| 22 | + - name: Configure GIT |
| 23 | + run: | |
| 24 | + git config --global user.email "${{ secrets.GH_SITE_DEPLOY_EMAIL }}" |
| 25 | + git config --global user.name "${{ secrets.GH_SITE_DEPLOY_NAME }}" |
| 26 | +
|
| 27 | + # Set up environment with Java and Maven |
| 28 | + - name: Setup JDK |
| 29 | + uses: actions/setup-java@v1 |
| 30 | + with: |
| 31 | + java-version: 1.8 |
| 32 | + |
| 33 | + # Set up dependency cache |
| 34 | + - name: Cache local Maven repository |
| 35 | + uses: actions/cache@v2 |
| 36 | + with: |
| 37 | + path: ~/.m2/repository |
| 38 | + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} |
| 39 | + restore-keys: | |
| 40 | + ${{ runner.os }}-maven- |
| 41 | +
|
| 42 | + # Build, deploy to ossrh, generate and stage site |
| 43 | + - name: Build, verify, deploy, generate site |
| 44 | + env: |
| 45 | + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} |
| 46 | + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} |
| 47 | + run: mvn -s ./.maven-settings.xml -Pcontinuous-integration -B -U clean deploy site |
| 48 | + |
| 49 | + # Deploy site to Github Pages |
| 50 | + # WORKAROUND for https://issues.apache.org/jira/browse/MSCMPUB-18 - deploy site in multiple steps for subset of modules |
| 51 | + - name: Stage and deploy site - Part 1 |
| 52 | + run: > |
| 53 | + mvn -s ./.maven-settings.xml -Pcontinuous-integration -B site:stage scm-publish:publish-scm |
| 54 | + --projects '.,parent,modules,modules/core,modules/selectors,modules/differences' |
| 55 | + -Dscmpublish.checkinComment="Maven site: ${{ github.repository }} - Part 1" |
| 56 | + -Dusername=${{ secrets.GH_SITE_DEPLOY_USERNAME }} |
| 57 | + -Dpassword=${{ secrets.GH_SITE_DEPLOY_PAT }} |
| 58 | + - name: Stage and deploy site - Part 2 |
| 59 | + run: > |
| 60 | + mvn -s ./.maven-settings.xml -Pcontinuous-integration -B site:stage scm-publish:publish-scm |
| 61 | + --projects '.,modules/interaction,modules/listeners,modules/galen,maven/specs-plugin' |
| 62 | + -Dscmpublish.checkinComment="Maven site: ${{ github.repository }} - Part 2" |
| 63 | + -Dusername=${{ secrets.GH_SITE_DEPLOY_USERNAME }} |
| 64 | + -Dpassword=${{ secrets.GH_SITE_DEPLOY_PAT }} |
| 65 | + - name: Stage and deploy site - Part 3 |
| 66 | + run: > |
| 67 | + mvn -s ./.maven-settings.xml -Pcontinuous-integration -B site:stage scm-publish:publish-scm |
| 68 | + --projects '!parent,!modules,!modules/core,!modules/selectors,!modules/differences,!modules/interaction,!modules/listeners,!modules/galen,!maven/specs-plugin' |
| 69 | + -Dscmpublish.checkinComment="Maven site: ${{ github.repository }} - Part 3" |
| 70 | + -Dusername=${{ secrets.GH_SITE_DEPLOY_USERNAME }} |
| 71 | + -Dpassword=${{ secrets.GH_SITE_DEPLOY_PAT }} |
0 commit comments