Skip to content

Commit

Permalink
Fix build steps (#50)
Browse files Browse the repository at this point in the history
* chore: comment out buildx build and push steps in workflow

* chore: disable pull_request trigger in buildx workflow

* fix: update image reference in buildx workflow to use ghcr.io

* refactor: simplify version retrieval in buildx workflow

* fix: restore version extraction logic in buildx workflow

* fix: restore Buildx and Push steps in workflow

* fix: enable image push in buildx workflow

* fix: update image tag to use ghcr.io in buildx workflow

* fix: disable image push and clean up version extraction in buildx workflow
  • Loading branch information
truestory1 authored Jan 15, 2025
1 parent 903995e commit d579753
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/buildx-on-pr.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: buildx-on-pr

on:
pull_request:
# pull_request:
workflow_dispatch:

env:
Expand Down
23 changes: 4 additions & 19 deletions .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: buildx

on:
workflow_dispatch:
# pull_request:
pull_request:
schedule:
- cron: '22 4 * * 0'
push:
Expand Down Expand Up @@ -40,31 +40,18 @@ jobs:
with:
context: .
file: Containerfile
tags: ${{ env.IMAGE_NAME }}:testing
tags: ghcr.io/${{ env.IMAGE_NAME }}:testing
platforms: ${{ env.PLATFORMS }}
provenance: false
cache-from: type=gha
cache-to: type=gha,mode=max
# push: true

- name: Load Built Image and Get Variables
id: vars
run: |
docker buildx build \
-f Containerfile \
-t ${{ env.IMAGE_NAME }}:testing \
--platform=linux/amd64 \
--cache-to type=gha,mode=max \
--cache-from type=gha \
--load \
.
CID=$(docker run -d ${{ env.IMAGE_NAME }}:testing)
VER_FULL=$(docker exec $CID rpm -q --queryformat '%{VERSION}' zpa-connector)
VER_FULL=$(docker run --rm ghcr.io/${{ env.IMAGE_NAME }}:testing rpm -q --queryformat '%{VERSION}' zpa-connector)
echo "VER_FULL=$VER_FULL" >> $GITHUB_ENV
docker rm -f $CID
VER_MINOR=$(echo $VER_FULL | cut -d. -f-2)
echo "VER_MINOR=$VER_MINOR" >> $GITHUB_ENV
VER_MAJOR=$(echo $VER_FULL | cut -d. -f-1)
echo "VER_MAJOR=$VER_MAJOR" >> $GITHUB_ENV
- name: Buildx and Push
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6
Expand All @@ -74,8 +61,6 @@ jobs:
tags: |
ghcr.io/${{ env.IMAGE_NAME }}:latest
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VER_FULL }}
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VER_MINOR }}
ghcr.io/${{ env.IMAGE_NAME }}:${{ env.VER_MAJOR }}
platforms: ${{ env.PLATFORMS }}
cache-from: type=gha
cache-to: type=gha,mode=max
Expand Down

0 comments on commit d579753

Please sign in to comment.