From 57b69a9340029bd6f9a9b6e7bb55d2de2f74696d Mon Sep 17 00:00:00 2001 From: Craig O'Donnell Date: Tue, 2 Jan 2024 16:19:34 +0000 Subject: [PATCH] build web outside of melange --- .github/workflows/alpha.yaml | 1 + .github/workflows/build-test.yaml | 15 +++++++-------- .github/workflows/release.yaml | 15 ++++++++------- deploy/melange.yaml.tmpl | 6 ------ 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/alpha.yaml b/.github/workflows/alpha.yaml index b7dac73108..82c5f13bcc 100644 --- a/.github/workflows/alpha.yaml +++ b/.github/workflows/alpha.yaml @@ -39,6 +39,7 @@ jobs: id-token: write # required to be able to assume the GCP SA identity to pull private Chainguard packages. steps: - uses: actions/checkout@v4 + # TODO: need to build web as the image depends on the static assets - uses: ./.github/actions/build-push-kotsadm-image with: chainguard-gcp-wif-pool: ${{ secrets.CHAINGUARD_GCP_WIF_POOL }} diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index 78406fd85f..6d104dcaf2 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -234,7 +234,7 @@ jobs: build-kots: runs-on: ubuntu-20.04 - needs: [ can-run-ci, build-web, deps-kots, generate-tag ] + needs: [ can-run-ci, deps-kots, generate-tag ] steps: - uses: actions/checkout@v4 @@ -247,12 +247,6 @@ jobs: go-version: '^1.20.0' cache: true - - name: Download web artifact - uses: actions/download-artifact@v4 - with: - name: web - path: ./web/dist - - name: Build kots env: GIT_TAG: ${{ needs.generate-tag.outputs.tag }} @@ -266,7 +260,7 @@ jobs: build-kotsadm: runs-on: ubuntu-20.04 - needs: [ can-run-ci, generate-tag ] + needs: [ can-run-ci, build-web, generate-tag ] permissions: id-token: write # required to be able to assume the GCP SA identity to pull private Chainguard packages. steps: @@ -283,6 +277,11 @@ jobs: with: ref: ${{github.event.pull_request.head.ref}} repository: ${{github.event.pull_request.head.repo.full_name}} + - name: Download web artifact + uses: actions/download-artifact@v4 + with: + name: web + path: ./web/dist - uses: ./.github/actions/build-push-kotsadm-image with: chainguard-gcp-wif-pool: ${{ secrets.CHAINGUARD_GCP_WIF_POOL }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0f2266236c..fb249f72d7 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -78,7 +78,7 @@ jobs: build-kots: runs-on: ubuntu-20.04 - needs: [build-web, generate-tag] + needs: [generate-tag] steps: - uses: actions/setup-go@v5 with: @@ -94,11 +94,6 @@ jobs: key: ${{ runner.os }}-go-kots-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-kots- - - name: Download web artifact - uses: actions/download-artifact@v4 - with: - name: web - path: ./web/dist - name: Build KOTS env: GIT_TAG: ${{ needs.generate-tag.outputs.tag }} @@ -112,13 +107,19 @@ jobs: build-kotsadm: runs-on: ubuntu-20.04 - needs: [generate-tag] + needs: [build-web, generate-tag] permissions: id-token: write # required to be able to assume the GCP SA identity to pull private Chainguard packages. steps: - name: Checkout uses: actions/checkout@v4 + - name: Download web artifact + uses: actions/download-artifact@v4 + with: + name: web + path: ./web/dist + - uses: ./.github/actions/build-push-kotsadm-image with: chainguard-gcp-wif-pool: ${{ secrets.CHAINGUARD_GCP_WIF_POOL }} diff --git a/deploy/melange.yaml.tmpl b/deploy/melange.yaml.tmpl index 0d9e757f1b..81e283cd56 100644 --- a/deploy/melange.yaml.tmpl +++ b/deploy/melange.yaml.tmpl @@ -18,8 +18,6 @@ environment: - busybox - git - go - - nodejs - - yarn environment: GOMODCACHE: '/var/cache/melange' @@ -57,10 +55,6 @@ pipeline: # TODO: fix pact build error on arm https://github.com/pact-foundation/pact-js-core/issues/264 export PACT_SKIP_BINARY_INSTALL=true - # Configure Yarn - yarn install --pure-lockfile --network-concurrency 1 --network-timeout 600000 - - make -C web deps build-kotsadm make kots build mv bin/kotsadm "${DESTDIR}/kotsadm"