Merge pull request #429 from openziti/tidy-build-workflow

tidy build workflow
This commit is contained in:
Kenneth Bingham 2023-10-27 18:59:10 -04:00 committed by GitHub
commit 2af4f8ef58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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