Skip to content

Commit

Permalink
Merge pull request #429 from openziti/tidy-build-workflow
Browse files Browse the repository at this point in the history
tidy build workflow
  • Loading branch information
qrkourier authored Oct 27, 2023
2 parents 02f1d3f + 86b1898 commit 2af4f8e
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2af4f8e

Please sign in to comment.