Skip to content

Commit

Permalink
ci: fixes build binary step, and updates github ref check
Browse files Browse the repository at this point in the history
  • Loading branch information
nxtcoder17 committed Feb 2, 2024
1 parent 7122a02 commit 82bda1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/kloudlite-cluster-autoscaler-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
paths:
- "cluster-autoscaler/**"
- ".github/workflows/**"

permissions:
contents: read
Expand Down Expand Up @@ -47,9 +48,11 @@ jobs:
tar -xf upx.tar.xz
sudo mv upx-4.2.1-amd64_linux/upx /usr/local/bin
- name: Build Binary
- name: Build Binary (check whether build works)
run: |
task build Out=$PWD/.github/workflows/container-build/app CWD=${{matrix.buildDir}}
pushd cluster-autoscaler
task build
popd
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
Expand All @@ -62,7 +65,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build & Push Image
if: startsWith(github.ref, 'refs/heads/release')
if: startsWith(github.ref, 'refs/heads/kloudlite-release')
run: |
set +e
IMAGE_TAG=$(echo ${GITHUB_REF#refs/heads/} | sed 's/kloudlite-release-//g')
Expand All @@ -88,5 +91,5 @@ jobs:
export GOARCH="$(go env GOARCH)"
pushd cluster-autoscaler
task docker:build TAG="$IMAGE_TAG"
task docker:build IMAGE=$image_name TAG="$IMAGE_TAG"
4 changes: 2 additions & 2 deletions cluster-autoscaler/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ tasks:
preconditions:
- sh: '[[ ! -z "{{.TAG}}" ]]'
msg: 'var TAG must be set'
vars:
IMAGE: ghcr.io/kloudlite/cluster-autoscaler
- sh: '[[ ! -z "{{.IMAGE}}" ]]'
msg: 'var IMAGE must be set'
cmds:
- task: build
- |+
Expand Down

0 comments on commit 82bda1e

Please sign in to comment.