Use help:evaluate for extracting Maven properties #129
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
# This workflow builds the documentation site, and deploys it to GitHub Pages. | |
# | |
# This is executed when a commit is pushed to the main branch. | |
name: Deploy site | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
name: GitHub Pages | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v2 | |
with: | |
java-version: 11 | |
distribution: "zulu" | |
- name: Cache local Maven repository | |
uses: actions/cache@v3 | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.os }}-maven- | |
- name: Extract Spark version | |
working-directory: lib/R | |
run: echo "SPARK_VERSION=$(mvn help:evaluate -Dexpression=pathling.Rapi.sparkVersion -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Extract Hadoop version | |
working-directory: lib/R | |
run: echo "HADOOP_VERSION=$(mvn help:evaluate -Dexpression=pathling.Rapi.hadoopVersion -q -DforceStdout)" >> $GITHUB_ENV | |
- name: Cache Spark | |
id: cache-spark | |
uses: actions/cache@v2 | |
with: | |
path: /home/runner/spark/spark-${{ env.SPARK_VERSION }}-bin-hadoop${{ env.HADOOP_VERSION }} | |
key: spark-${{ env.SPARK_VERSION }}-bin-hadoop${{ env.HADOOP_VERSION }} | |
- name: Install Pandoc | |
uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: "4.1.3" | |
use-public-rspm: true | |
- name: Install texlive-latex-base | |
run: sudo apt-get install -y texlive-latex-base texlive-fonts-extra | |
- name: Run the verify goal with Maven | |
run: >- | |
mvn --batch-mode verify | |
-pl site -am | |
-Pdocs | |
-DskipTests | |
timeout-minutes: 30 | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./site/target/site |