Added logging in case the handled panic #47
This file contains hidden or 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 docker container image" | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'oxybox/src/**' | |
| - '.github/workflows/BUILD_AND_DEPLOY.yml' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'oxybox/src/**' | |
| - '.github/workflows/BUILD_AND_DEPLOY.yml' | |
| jobs: | |
| # validate that the docker image is built. | |
| # will only scan for vulnerabilities and push to acr on push events | |
| docker-build: | |
| name: Build docker image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| name: Checkout | |
| - name: Get project version from Cargo.toml | |
| id: get_version | |
| run: | | |
| version=$(grep '^version' oxybox/Cargo.toml | head -n 1 | cut -d '"' -f2) | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_PASSWORD }} | |
| # registry: registry-1.docker.io | |
| - name: Docker build image | |
| shell: bash | |
| id: build | |
| env: | |
| DOCKERFILE: ./oxybox/Dockerfile | |
| TAG: ${{ steps.determine-tag.outputs.tag }} | |
| CONTEXT: ./oxybox | |
| VERSION: ${{ steps.get_version.outputs.version }} | |
| run: | | |
| docker buildx build \ | |
| --no-cache \ | |
| --label time=$(date +%Y%m%d%H%M%S) \ | |
| --label branch=${GITHUB_REF_NAME} \ | |
| --label commit=${{ github.sha }} \ | |
| --file ${DOCKERFILE} \ | |
| --build-arg "BRANCH=${{ github.ref_name }}" \ | |
| --build-arg "COMMIT=${{ github.sha }}" \ | |
| --tag baseflow/oxybox:latest \ | |
| --tag baseflow/oxybox:${VERSION} \ | |
| ${CONTEXT} | |
| - uses: aquasecurity/trivy-action@master | |
| name: Vulnerability Scan | |
| with: | |
| image-ref: baseflow/oxybox:latest | |
| scanners: vuln #,config,secret | |
| severity: 'CRITICAL,HIGH' | |
| vuln-type: 'os,library' | |
| ignore-unfixed: true | |
| exit-code: '1' | |
| format: 'table' | |
| - name: Push docker image | |
| shell: bash | |
| run: | | |
| docker push baseflow/oxybox --all-tags |