From 74e43e52f975eb154206b109cd47f84c347d8f37 Mon Sep 17 00:00:00 2001 From: ppettitau Date: Tue, 15 Oct 2024 11:42:00 +1000 Subject: [PATCH] [ERP-2718] Add build workflow Chain deploy workflow after completed build workflow --- .github/workflows/build.yaml | 36 +++++++++++++++++++++++++++++++++++ .github/workflows/deploy.yaml | 6 +++++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..67bc94d --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,36 @@ +name: Build +on: + push: +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + - name: Install api dependencies + working-directory: api + run: npm install + - name: Build api package + working-directory: api + run: npm run build + - name: Run api tests + working-directory: api + run: npm run test + - name: Install deployment dependencies + working-directory: deployment + run: npm install + - name: Build deployment package + working-directory: deployment + run: npm run build + - name: Install frontend dependencies + working-directory: frontend + run: yarn install + - name: Build frontend package + working-directory: frontend + run: yarn build + - name: Install serve dependencies + working-directory: serve + run: npm install diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 0378fcf..dfc7b8f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -1,10 +1,14 @@ name: Deploy CDK Stack on: - push: + workflow_run: + workflows: + - build branches: - dev - qa - prod + types: + - completed jobs: test: runs-on: ubuntu-latest