From 86b18987493f52b2d7f33ce1b2a43723fbe4fb91 Mon Sep 17 00:00:00 2001 From: Kenneth Bingham Date: Wed, 25 Oct 2023 14:37:10 -0400 Subject: [PATCH] tidy build workflow --- .github/workflows/ci-build.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index f2072ac4..cf2d8e6a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -27,22 +27,29 @@ jobs: with: node-version: 18.x - - run: npm install + - name: install ui node modules + shell: bash + run: npm install working-directory: ui - - run: npm run build + - name: build node ui + shell: bash + run: npm run build working-directory: ui env: CI: "true" - name: go install + shell: bash run: go install -ldflags "-X github.com/openziti/zrok/build.Version=${{ github.ref }} -X github.com/openziti/zrok/build.Hash=${{ github.sha }}" ./... - - name: test + - name: go test + shell: bash run: go test -v ./... - name: solve GOBIN id: solve_go_bin + shell: bash run: | echo DEBUG: go_path="$(go env GOPATH)" echo go_bin="$(go env GOPATH)/bin" >> $GITHUB_OUTPUT @@ -53,6 +60,7 @@ jobs: name: linux-amd64 path: ${{ steps.solve_go_bin.outputs.go_bin }}/zrok if-no-files-found: error + # build a release candidate container image for branches named "main" or like "v*" rc-container-build: needs: ubuntu-build @@ -62,6 +70,7 @@ jobs: steps: - name: Set a container image tag from the branch name id: slug + shell: bash run: | echo branch_tag=$(sed 's/[^a-z0-9_-]/__/gi' <<< "${GITHUB_REF#refs/heads/}") >> $GITHUB_OUTPUT @@ -94,11 +103,10 @@ jobs: ZROK_CONTAINER_IMAGE_REPO: ${{ vars.ZROK_CONTAINER_IMAGE_REPO || 'openziti/zrok' }} ZROK_CONTAINER_IMAGE_TAG: ${{ steps.slug.outputs.branch_tag }} id: tagprep_cli + shell: bash run: | - DOCKER_TAGS="" - DOCKER_TAGS="${ZROK_CONTAINER_IMAGE_REPO}:${ZROK_CONTAINER_IMAGE_TAG}" - echo "DEBUG: DOCKER_TAGS=${DOCKER_TAGS}" - echo DOCKER_TAGS="${DOCKER_TAGS}" >> $GITHUB_OUTPUT + echo DOCKER_TAGS="${ZROK_CONTAINER_IMAGE_REPO}:${ZROK_CONTAINER_IMAGE_TAG}" \ + | tee -a $GITHUB_OUTPUT - name: Build & Push Linux AMD64 CLI Container Image to Hub uses: docker/build-push-action@v3