From 1342bd018317a44fd9f97dd93c31523941306c29 Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Wed, 20 Apr 2022 11:04:36 -0700 Subject: [PATCH] Refactor build ci worfklow to decouple UI build (#1975) Refactor build workflow to stop building the UI and consuming UI artifacts --- .github/workflows/build.yml | 75 +++++++++++-------------------------- 1 file changed, 21 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 79ca883464..34afb30120 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,25 +96,14 @@ jobs: - name: Set sha id: set-sha run: echo "::set-output name=sha::$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" - - uses: actions/checkout@v2 - with: - repository: "hashicorp/boundary-ui" - ref: ${{ steps.set-sha.outputs.sha }} - path: "internal/ui/.tmp/boundary-ui" - - name: Setup node and yarn - uses: actions/setup-node@v2 + - name: Download UI artifact + uses: dawidd6/action-download-artifact@v2 with: - node-version: '14' - cache: 'yarn' - cache-dependency-path: 'internal/ui/.tmp/boundary-ui/yarn.lock' - - name: Install Yarn - run: | - npm install -g yarn - - name: UI Build - working-directory: internal/ui/.tmp/boundary-ui - run: | - yarn install --network-timeout 300000 - yarn build:ui:admin + workflow: build-admin-ui.yaml + commit: ${{ steps.set-sha.outputs.sha }} + repo: "hashicorp/boundary-ui" + name: admin-ui + path: internal/ui/.tmp/boundary-ui/ui/admin/dist - name: Go Build env: GOOS: ${{ matrix.goos }} @@ -162,25 +151,14 @@ jobs: - name: Set sha id: set-sha run: echo "::set-output name=sha::$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" - - uses: actions/checkout@v2 - with: - repository: "hashicorp/boundary-ui" - ref: ${{ steps.set-sha.outputs.sha }} - path: "internal/ui/.tmp/boundary-ui" - - name: Setup node and yarn - uses: actions/setup-node@v2 + - name: Download UI artifact + uses: dawidd6/action-download-artifact@v2 with: - node-version: '14' - cache: 'yarn' - cache-dependency-path: 'internal/ui/.tmp/boundary-ui/yarn.lock' - - name: Install Yarn - run: | - npm install -g yarn - - name: UI Build - working-directory: internal/ui/.tmp/boundary-ui - run: | - yarn install --network-timeout 300000 - yarn build:ui:admin + workflow: build-admin-ui.yaml + commit: ${{ steps.set-sha.outputs.sha }} + repo: "hashicorp/boundary-ui" + name: admin-ui + path: internal/ui/.tmp/boundary-ui/ui/admin/dist - name: Go Build env: GOOS: ${{ matrix.goos }} @@ -255,25 +233,14 @@ jobs: - name: Set sha id: set-sha run: echo "::set-output name=sha::$(head -n1 internal/ui/VERSION | cut -d ' ' -f1)" - - uses: actions/checkout@v2 + - name: Download UI artifact + uses: dawidd6/action-download-artifact@v2 with: - repository: "hashicorp/boundary-ui" - ref: ${{ steps.set-sha.outputs.sha }} - path: "internal/ui/.tmp/boundary-ui" - - name: Setup node and yarn - uses: actions/setup-node@v2 - with: - node-version: '14' - cache: 'yarn' - cache-dependency-path: 'internal/ui/.tmp/boundary-ui/yarn.lock' - - name: Install Yarn - run: | - npm install -g yarn - - name: UI Build - working-directory: internal/ui/.tmp/boundary-ui - run: | - yarn install --network-timeout 300000 - yarn build:ui:admin + workflow: build-admin-ui.yaml + commit: ${{ steps.set-sha.outputs.sha }} + repo: "hashicorp/boundary-ui" + name: admin-ui + path: internal/ui/.tmp/boundary-ui/ui/admin/dist - name: Go Build env: GOOS: ${{ matrix.goos }}