Hyathi/Stem-Extractor
0
1# This workflow uses actions that are not certified by GitHub.2# They are provided by a third-party and are governed by3# separate terms of service, privacy policy, and support4# documentation.5 6# GitHub recommends pinning actions to a commit SHA.7# To get a newer version, you will need to update the SHA.8# You can also reference a tag or branch, but the action may change without warning.9 10name: Publish Docker image11 12on:13 14 push:15 tags:16 - v*17 18 workflow_dispatch:19 20env:21 image: hadr0n/scraibe22 23jobs:24 push_to_registry:25 name: Push Docker image to Docker Hub26 runs-on: ubuntu-latest27 permissions:28 packages: write29 contents: read30 security-events: write31 steps:32 - name: Check out the repo33 uses: actions/checkout@v434 with:35 fetch-tags: true36 fetch-depth: 037 38 - name: Get Version Tag39 id: version40 run: |41 echo "tag=$(git describe --tags --abbrev=0)" >> $GITHUB_OUTPUT42 43 - name: Overwrite label tag44 run: sed -i 's/LABEL version=".*"/LABEL version="'${{ steps.version.outputs.tag }}'"/' Dockerfile45 46 - name: Test name and tag47 run: | 48 echo "${{ env.image }}:latest,${{ env.image }}:${{ steps.version.outputs.tag }}"49 50 - name: Log in to Docker Hub51 uses: docker/login-action@v352 with:53 username: ${{ secrets.DOCKERHUB_USERNAME }}54 password: ${{ secrets.DOCKERHUB_TOKEN }}55 56 - name: Build and push Docker image57 id: push58 uses: docker/build-push-action@v559 with:60 context: .61 file: ./Dockerfile62 push: true63 tags: "${{ env.image }}:latest,${{ env.image }}:${{ steps.version.outputs.tag }}"64 65 - name: SBOM Generation66 uses: anchore/sbom-action@v067 with:68 image: ${{ env.image }}:latest69 70 - name: Scan image71 id: scan72 uses: anchore/scan-action@v373 with:74 image: ${{ env.image }}:latest75 fail-build: false76 77 - name: upload Anchore scan SARIF report78 uses: github/codeql-action/upload-sarif@v379 with:80 sarif_file: ${{ steps.scan.outputs.sarif }}81 82 # - name: Inspect action SARIF report83 # run: cat ${{ steps.scan.outputs.sarif }}84 85 - uses: actions/upload-artifact@v486 with:87 name: SARIF report88 path: ${{ steps.scan.outputs.sarif }}89 90 # - name: Generate artifact attestation91 # uses: actions/attest-build-provenance@v192 # with:93 # subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}94 # subject-digest: ${{ steps.push.outputs.digest }}95 # push-to-registry: false96 