Merge pull request #5 from HASEL-UZH/sonarqube #9
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: Deploy Project to App Engine | |
on: | |
push: | |
branches: | |
- main | |
# run the workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Test and Sonarqube | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository code | |
uses: actions/checkout@v4 | |
- name: Install Java 17 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: Test and analyze | |
run: ./gradlew test jacocoTestReport sonar | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
deploy: | |
name: Deploying to Google Cloud | |
runs-on: ubuntu-latest | |
# needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Deploy to App Engine | |
id: deploy | |
uses: google-github-actions/[email protected] | |
with: | |
deliverables: app.yaml | |
version: v1 | |
credentials: ${{ secrets.GCP_SERVICE_CREDENTIALS }} | |
- name: Test | |
run: curl "${{ steps.deploy.outputs.url }}" |