Skip to content

Commit

Permalink
fix: publish ratify image with plugin (#916)
Browse files Browse the repository at this point in the history
  • Loading branch information
susanshi committed Jul 6, 2023
1 parent 0d03e79 commit f819c03
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,27 @@ jobs:
DATE=$(date +'%Y%m%d')
COMMIT=${{ github.sha }}
REPOSITORY=ghcr.io/${{ github.repository }}
REPOSITORYBASE=ghcr.io/${{ github.repository }}-base
REPOSITORYCRD=ghcr.io/${{ github.repository }}-crds
if [[ "${VERSION}" == "${BRANCH_NAME}" ]]; then
VERSION=$(git rev-parse --short HEAD)
fi
if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.event_name }}" == "schedule" ]]; then
VERSION=dev.${DATE}.${COMMIT:0:7}
REPOSITORY=${REPOSITORY}-dev
REPOSITORYBASE=${REPOSITORYBASE}-dev
REPOSITORYCRD=${REPOSITORYCRD}-dev
fi
echo ::set-output name=version::${VERSION}
echo ::set-output name=ref::${REPOSITORY}:${VERSION}
echo ::set-output name=baseref::${REPOSITORYBASE}:${VERSION}
echo ::set-output name=crdref::${REPOSITORYCRD}:${VERSION}
- name: docker build ratify
- name: docker build ratify base
run: |
docker build -f ./httpserver/Dockerfile --label org.opencontainers.image.revision=${{ github.sha }} -t ${{ steps.prepare.outputs.ref }} .
docker build -f ./httpserver/Dockerfile --label org.opencontainers.image.revision=${{ github.sha }} -t ${{ steps.prepare.outputs.baseref }} .
- name: docker build ratify with plugin
run: |
docker build -f ./httpserver/Dockerfile --build-arg build_cosign=true --build-arg build_sbom=true --build-arg build_licensechecker=true --build-arg build_schemavalidator=true --label org.opencontainers.image.revision=${{ github.sha }} -t ${{ steps.prepare.outputs.ref }} .
- name: docker build ratify-crds
run: |
docker build --build-arg KUBE_VERSION="1.25.4" --build-arg TARGETOS="linux" --build-arg TARGETARCH="amd64" -f crd.Dockerfile --label org.opencontainers.image.revision=${{ github.sha }} -t ${{ steps.prepare.outputs.crdref }} ./charts/ratify/crds
Expand All @@ -51,7 +57,10 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: docker push ratify
- name: docker push ratify base
run: |
docker push ${{ steps.prepare.outputs.baseref }}
- name: docker push ratify with plugin
run: |
docker push ${{ steps.prepare.outputs.ref }}
- name: docker push ratify-crds
Expand All @@ -60,4 +69,4 @@ jobs:
- name: clear
if: always()
run: |
rm -f ${HOME}/.docker/config.json
rm -f ${HOME}/.docker/config.json

0 comments on commit f819c03

Please sign in to comment.