From 297c37dfe81ed2c7ad864dde95c0daa462c1db90 Mon Sep 17 00:00:00 2001 From: zero88 Date: Fri, 27 Jan 2023 14:10:14 +0700 Subject: [PATCH] [:init:gha] use shared workflows --- .github/workflows/backend.yml | 16 ++++++++++++++++ .github/workflows/frontend.yml | 13 +++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 0db8ce2..dc756cb 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -13,6 +13,10 @@ on: types: [ opened, synchronize, reopened, closed ] branches: [ main ] +env: + JAVA_DIST: 'temurin' + JAVA_VERSION: 11 + jobs: context: uses: play-iot/gha-ci/.github/workflows/project-context.yml@main @@ -22,3 +26,15 @@ jobs: githubToken: ${{ secrets.BEEIO_CI_TOKEN }} gpgKey: ${{ secrets.OSS_GPG_PRIVATE_KEY }} gpgPassphrase: ${{ secrets.OSS_GPG_PASSPHARSE }} + + build: + needs: context + if: needs.context.outputs.shouldBuild == 'true' + uses: play-iot/gha-ci/.github/workflows/gradle-build.yml@main + with: + profile: 'all' + version: ${{ needs.context.outputs.version }} + semanticVersion: ${{ needs.context.outputs.semanticVersion }} + hashVersion: ${{ needs.context.outputs.commitId }} + javaDist: 'temurin' + javaVersion: '11' diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml index c125233..a9da131 100644 --- a/.github/workflows/frontend.yml +++ b/.github/workflows/frontend.yml @@ -18,13 +18,6 @@ env: jobs: build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - uses: play-iot/gha-ci/yarn-build@main - with: - nodeVersion: ${{ env.NODE_VERSION }} - - - name: Test - run: yarn test + uses: play-iot/gha-ci/.github/workflows/yarn-build.yml@main + with: + nodeVersion: '16'