ci: update trivy-action version #72
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 and Push | |
| on: | |
| push: | |
| branches: | |
| - 'develop' | |
| - 'release/**' | |
| paths-ignore: | |
| - '**.md' | |
| - 'changelogs/**' | |
| - 'docs/**' | |
| - 'design/**' | |
| - 'LICENSE' | |
| - 'MAINTAINERS' | |
| jobs: | |
| lint: | |
| uses: ./.github/workflows/lint.yml | |
| with: | |
| branch-name: ${{ github.ref_name }} | |
| tests: | |
| needs: ["lint"] | |
| uses: ./.github/workflows/tests.yml | |
| secrets: inherit | |
| provisioner-localpv: | |
| runs-on: ubuntu-22.04 | |
| needs: ['lint'] | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Set Image Org | |
| # sets the default IMAGE_ORG to openebs | |
| run: | | |
| [ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}} | |
| echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV | |
| - name: Set CI Tag | |
| run: | | |
| BRANCH=${{ github.ref_name }} | |
| echo "BRANCH=$BRANCH" >> $GITHUB_ENV | |
| CI_TAG=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml) | |
| echo "TAG=${CI_TAG}" >> $GITHUB_ENV | |
| - name: Set Build Date | |
| id: date | |
| run: | | |
| echo "DATE=$(date -u +'%Y-%m-%dT%H:%M:%S%Z')" >> $GITHUB_OUTPUT | |
| - name: Docker meta | |
| id: docker_meta | |
| uses: docker/metadata-action@v4 | |
| with: | |
| # add each registry to which the image needs to be pushed here | |
| images: | | |
| ${{ env.IMAGE_ORG }}/provisioner-localpv | |
| quay.io/${{ env.IMAGE_ORG }}/provisioner-localpv | |
| ghcr.io/${{ env.IMAGE_ORG }}/provisioner-localpv | |
| tags: | | |
| type=raw,value=latest,enable=false | |
| type=raw,value=${{ env.TAG }} | |
| - name: Print Tag info | |
| run: | | |
| echo "BRANCH: ${{ env.BRANCH }}" | |
| echo "${{ steps.docker_meta.outputs.tags }}" | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| version: v0.13.1 | |
| - uses: ./.github/actions/registry-login | |
| with: | |
| docker-user: ${{ secrets.DOCKERHUB_USERNAME }} | |
| docker-token: ${{ secrets.DOCKERHUB_TOKEN }} | |
| quay-user: ${{ secrets.QUAY_USERNAME }} | |
| quay-token: ${{ secrets.QUAY_TOKEN }} | |
| ghcr-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and Push multi-arch Image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| file: ./buildscripts/provisioner-localpv/provisioner-localpv.Dockerfile | |
| push: true | |
| load: false | |
| platforms: linux/amd64, linux/arm64, linux/arm/v7, linux/ppc64le | |
| tags: | | |
| ${{ steps.docker_meta.outputs.tags }} | |
| build-args: | | |
| DBUILD_DATE=${{ steps.date.outputs.DATE }} | |
| DBUILD_REPO_URL=https://github.com/openebs/dynamic-localpv-provisioner | |
| DBUILD_SITE_URL=https://openebs.io | |
| BRANCH=${{ env.BRANCH }} | |
| release-chart: | |
| runs-on: ubuntu-22.04 | |
| needs: ['tests', 'provisioner-localpv'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Publish provisioner-localpv develop or prerelease helm chart | |
| uses: stefanprodan/helm-gh-pages@master | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| charts_dir: ./deploy/helm |