| name: Site Build |
| |
| on: |
| push: |
| branches: |
| - master |
| paths: |
| - 'docs/**' |
| - 'site/**' |
| pull_request: |
| branches: |
| - master |
| paths: |
| - 'docs/**' |
| - 'site/**' |
| # allow manually run the action: |
| workflow_dispatch: |
| |
| concurrency: |
| group: ${{ github.workflow }}-${{ github.ref }} |
| cancel-in-progress: true |
| |
| env: |
| MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3 |
| |
| jobs: |
| test: |
| runs-on: ubuntu-latest |
| if: github.event_name == 'pull_request' |
| |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Cache Maven packages |
| uses: actions/cache@v3 |
| with: |
| path: ~/.m2 |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2- |
| - name: Check Apache Header |
| run: mvn apache-rat:check |
| - name: Test compile website |
| run: mvn -P site -P compile-site -P compile-site-1.2 -P compile-site-1.1 -P compile-site-1.0 -P compile-site-0.13 compile -pl site |
| |
| deploy: |
| runs-on: ubuntu-latest |
| if: github.event_name == 'workflow_dispatch' && github.ref_name == 'master' || github.event_name == 'push' |
| |
| steps: |
| - uses: actions/checkout@v3 |
| - name: Cache Maven packages |
| uses: actions/cache@v3 |
| with: |
| path: ~/.m2 |
| key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} |
| restore-keys: ${{ runner.os }}-m2- |
| - name: Compile and deploy website |
| env: |
| IOTDB_WEBSITE_BUILD: ${{ secrets.IOTDB_WEBSITE_BUILD }} |
| run: | |
| git config --global url."https://asf-ci-deploy:$IOTDB_WEBSITE_BUILD@github.com/apache/".insteadOf "https://gitbox.apache.org/repos/asf/" |
| git config --global user.name github-actions |
| git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com |
| mvn -P site -P compile-site -P compile-site-1.2 -P compile-site-1.1 -P compile-site-1.0 -P compile-site-0.13 compile scm-publish:publish-scm -pl site |