fix CVE-2023-44487 #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Push | |
on: | |
push: | |
branches: [main] | |
tags: | |
- v* | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
env: | |
CI: true | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build develop image | |
run: make build.develop | |
- name: Run lint | |
run: ./scripts/develop.sh make fmt | |
- name: Run unit test | |
run: ./scripts/develop.sh make test | |
build: | |
needs: test | |
runs-on: ubuntu-latest | |
env: | |
IMAGE_NAME: kserve/rest-proxy | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build runtime image | |
run: make build | |
- name: Log in to Docker Hub | |
if: github.event_name == 'push' | |
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
- name: Push to Docker Hub | |
if: github.event_name == 'push' | |
run: | | |
# Strip git ref prefix from version | |
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,') | |
echo $VERSION | |
# Use Docker `latest` tag convention | |
[ "$VERSION" == "main" ] && VERSION=latest | |
docker tag ${{ env.IMAGE_NAME }}:latest ${{ env.IMAGE_NAME }}:$VERSION | |
docker push ${{ env.IMAGE_NAME }}:$VERSION |