cicd: use java vendor & version from GH variables #219
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
name: build | |
on: | |
pull_request: | |
push: | |
branches: [ master ] | |
jobs: | |
tests: | |
uses: ./.github/workflows/tests.yml | |
sonar-cloud: | |
runs-on: ubuntu-latest | |
needs: tests | |
steps: | |
- name: Git checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: report-output | |
path: build/reports | |
- name: Setup java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: ${{ vars.JAVA_VENDOR }} | |
java-version: ${{ vars.JAVA_VERSION }} | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: wrapper | |
- name: SonarCloud analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ./gradlew sonar --info | |
deploy-gh-pages: | |
if: github.ref == 'refs/heads/master' | |
runs-on: ubuntu-latest | |
needs: tests | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |