Revert "- enhancements" #22
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: Commit Stage | |
on: push | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ubaid4j/es | |
VERSION: 0.0.1-SNAPSHOT | |
jobs: | |
package: | |
name: Package and Publish | |
if: ${{ github.ref == 'refs/heads/main' }} | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: read | |
packages: write | |
security-events: write | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Set up JDK | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Build container image | |
run: | | |
chmod +x mvnw | |
./mvnw spring-boot:build-image -Pci -Pnative | |
- name: OCI image vulnerability scanning | |
uses: anchore/scan-action@v3 | |
id: scan | |
with: | |
image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} | |
fail-build: false | |
severity-cutoff: high | |
acs-report-enable: true | |
- name: Upload vulnerability report | |
uses: github/codeql-action/upload-sarif@v2 | |
if: success() || failure() | |
with: | |
sarif_file: ${{ steps.scan.outputs.sarif }} | |
- name: Log into container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish container image | |
run: docker push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }} |