name: statistics-deploy on: push: branches: [ master ] paths: - 'statistics/**' env: JAVA_VERSION: "15" JAVA_DISTRIBUTION: "zulu" GCP_SA_KEY_INFRA: ${{ secrets.GCP_SA_KEY_INFRA }} GCP_SA_KEY_APP: ${{ secrets.GCP_SA_KEY_APP }} MONITORING_SLACK_URL: ${{ secrets.MONITORING_SLACK_URL }} jobs: statistics-deploy-build: runs-on: ubuntu-20.04 concurrency: group: ${{ github.ref }}-statistics-deploy-build cancel-in-progress: true steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DISTRIBUTION }} java-version: ${{ env.JAVA_VERSION }} - name: Set up Gradle uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch - name: Set up secrets run: | echo "$GCP_SA_KEY_INFRA" >> ./statistics/infra/credentials-gcp-infra.json echo "$GCP_SA_KEY_APP" >> ./credentials-gcp-app.json echo MONITORING_SLACK_URL="$MONITORING_SLACK_URL" >> ./common/monitoring/secrets.properties - name: Build project run: | set -o pipefail && cd statistics && ./gradlew --no-daemon assemble && cd .. - name: Deploy infrastructure uses: pulumi/actions@v5 with: command: up stack-name: prod work-dir: statistics/infra env: PULUMI_ACCESS_TOKEN: ${{ secrets.PULUMI_ACCESS_TOKEN }} - name: Artifacts uses: actions/upload-artifact@v4 if: always() # Ensure all artifacts are collected, even after errors with: name: Build path: | **/build **/secrets.properties statistics/infra statistics-deploy-test: runs-on: ubuntu-20.04 concurrency: group: ${{ github.ref }}-statistics-deploy-test cancel-in-progress: true steps: - name: Checkout uses: actions/checkout@v4 - name: Set up Java uses: actions/setup-java@v4 with: distribution: ${{ env.JAVA_DISTRIBUTION }} java-version: ${{ env.JAVA_VERSION }} - name: Set up Gradle uses: gradle/actions/setup-gradle@v3 # By default, cache is only saved on the 'master' branch - name: Set up secrets run: | echo "$GCP_SA_KEY_INFRA" >> ./statistics/infra/credentials-gcp-infra.json echo "$GCP_SA_KEY_APP" >> ./credentials-gcp-app.json echo MONITORING_SLACK_URL="$MONITORING_SLACK_URL" >> ./common/monitoring/secrets.properties - name: Test run: | set -o pipefail && cd statistics && ./gradlew --no-daemon --continue jsTest && cd .. - name: Generate test report uses: mikepenz/action-junit-report@v4 if: always() # Ensure all test reports are collected, even after errors with: report_paths: '**/build/test-results/**/TEST-*.xml' check_name: 'statistics-deploy-test-results' - name: Artifacts uses: actions/upload-artifact@v4 if: always() # Ensure all artifacts are collected, even after errors with: name: Tests path: '**/build/test-results/**/TEST-*.xml'