Merge pull request #750 from openebs/create-pull-request/patch-develop #132
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: | |
| - "docs/**" | |
| - "design/**" | |
| - "changelogs/**" | |
| - "*.md" | |
| - "MAINTAINERS" | |
| jobs: | |
| lint: | |
| uses: ./.github/workflows/lint.yml | |
| with: | |
| branch-name: ${{ github.ref_name }} | |
| tests: | |
| needs: ["lint"] | |
| permissions: | |
| contents: read | |
| id-token: write | |
| uses: ./.github/workflows/tests.yml | |
| secrets: inherit | |
| csi-driver: | |
| runs-on: ubuntu-latest | |
| needs: ["lint"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set Image Org | |
| run: | | |
| [ -z "${{ secrets.IMAGE_ORG }}" ] && IMAGE_ORG=openebs || IMAGE_ORG=${{ secrets.IMAGE_ORG}} | |
| echo "IMAGE_ORG=${IMAGE_ORG}" >> $GITHUB_ENV | |
| - name: Set IMAGE_TAG and BRANCH | |
| run: | | |
| BRANCH=${{ github.ref_name }} | |
| echo "BRANCH=$BRANCH" >> $GITHUB_ENV | |
| echo "IMAGE_TAG=$(awk -F': ' '/^version:/ {print $$2}' deploy/helm/charts/Chart.yaml)" >> $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@v6 | |
| with: | |
| # add each registry to which the image needs to be pushed here | |
| images: | | |
| ${{ env.IMAGE_ORG }}/zfs-driver | |
| quay.io/${{ env.IMAGE_ORG }}/zfs-driver | |
| ghcr.io/${{ env.IMAGE_ORG }}/zfs-driver | |
| tags: | | |
| type=raw,value=latest,enable=false | |
| type=raw,value=${{ env.IMAGE_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@v4 | |
| with: | |
| platforms: all | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v4 | |
| with: | |
| version: v0.33.0 | |
| - 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 & Push Image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| file: ./buildscripts/zfs-driver/Dockerfile.buildx | |
| push: true | |
| sbom: true | |
| provenance: mode=max | |
| platforms: linux/amd64, linux/arm64 | |
| tags: | | |
| ${{ steps.docker_meta.outputs.tags }} | |
| build-args: | | |
| DBUILD_DATE=${{ steps.date.outputs.DATE }} | |
| DBUILD_REPO_URL=https://github.com/openebs/zfs-localpv | |
| DBUILD_SITE_URL=https://openebs.io | |
| BRANCH=${{ env.BRANCH }} | |
| release-chart: | |
| runs-on: ubuntu-latest | |
| needs: ["csi-driver", "tests"] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Publish zfs localpv develop or prerelease helm chart | |
| uses: stefanprodan/helm-gh-pages@master | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| charts_dir: ./deploy/helm |