Skip to content

Commit

Permalink
cicd: use extracted git archive
Browse files Browse the repository at this point in the history
I thought that docker could use a tarball context, but it can only do
this for a URL, for some reason. This copies the dance that the release
build step does.

Signed-off-by: Hank Donnay <hdonnay@redhat.com>
  • Loading branch information
hdonnay committed Dec 9, 2022
1 parent aff17a4 commit 1dfb42a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/script/nightly-module.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ git diff
test -d vendor && rm -rf vendor
go mod tidy
go mod vendor
printf '::set-output name=clair_version::%s\n' "$(git describe --tags --always --dirty --match 'v4.*')"
echo "clair_version=$(git describe --tags --always --dirty --match 'v4.*')" >> "$GITHUB_OUTPUT"
7 changes: 5 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,17 @@ jobs:
password: ${{ secrets.QUAY_TOKEN }}
- name: Export
# This exports the current state of the main branch, and appends our modified go module files.
run: 'git archive -o clair.tar --add-file=go.mod --add-file=go.sum "main"'
run: |
mkdir "${{ runner.temp }}/build"
git archive --add-file=go.mod --add-file=go.sum origin/main |
tar -x -C "${{ runner.temp }}/build"
- uses: docker/build-push-action@v3
with:
build-args: |
GO_VERSION=${{ env.GO_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max
context: clair.tar
context: ${{ runner.temp }}/build
platforms: linux/amd64,linux/arm64
push: ${{ steps.setup.outputs.push && steps.novelty.outputs.cache-hit != 'true' }}
tags: |
Expand Down

0 comments on commit 1dfb42a

Please sign in to comment.