Skip to content

Commit

Permalink
cicd: move container building out of container
Browse files Browse the repository at this point in the history
Signed-off-by: ldelossa <ldelossa@redhat.com>
  • Loading branch information
ldelossa committed Sep 29, 2020
1 parent 2f5756d commit 195ce7a
Showing 1 changed file with 27 additions and 7 deletions.
34 changes: 27 additions & 7 deletions .github/workflows/cut-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,6 @@ jobs:
tar -rf clair.tar --transform "s,^,${PREFIX}," vendor
gzip clair.tar
- name: Build Release Container
run: |
build=$(mktemp -d)
trap "rm -rf '${build}'" EXIT
tar -xzf clair.tar.gz -C "${build}" --strip-components 1
docker build --build-arg CLAIR_VERSION --tag "${TAG}" "${build}"
- name: Create Release
uses: actions/create-release@latest
id: create_release
Expand Down Expand Up @@ -149,6 +142,33 @@ jobs:
asset_name: clairctl-windows-386
asset_content_type: application/octet-stream

deploy-container:
name: Deploy Container
runs-on: ubuntu-latest
needs: release
steps:
- name: Setup
run: |
tag=`basename ${{ github.ref }}`
cat <<.
::set-env name=VERSION::${tag}
::set-env name=CLAIR_VERSION::${tag}
::set-env name=PREFIX::clair-${tag}/
::set-env name=TAG::quay.io/projectquay/clair:${tag#v}
::set-env name=QUAY_USER::projectquay+clair_github
::add-mask::${{ secrets.QUAY_TOKEN }}
.
- name: Checkout
uses: actions/checkout@v2

- name: Build Release Container
run: |
build=$(mktemp -d)
trap "rm -rf '${build}'" EXIT
tar -xzf clair.tar.gz -C "${build}" --strip-components 1
docker build --build-arg CLAIR_VERSION --tag "${TAG}" "${build}"
- name: Publish Release Container
run: |
docker login -u "${QUAY_USER}" -p '${{ secrets.QUAY_TOKEN }}' quay.io
Expand Down

0 comments on commit 195ce7a

Please sign in to comment.