test: test ci #1
Workflow file for this run
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: Release Images and Charts | |
| on: | |
| release: | |
| types: | |
| - "created" | |
| push: | |
| branches: | |
| - helm-oci | |
| jobs: | |
| release-images-and-chart: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: cachix/install-nix-action@v22 | |
| - name: Pre-populate nix-shell | |
| run: | | |
| export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) | |
| echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV | |
| nix-shell --pure --run "echo" ./shell.nix | |
| - 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: Log in to GHCR for Helm | |
| run: nix-shell --pure --run "echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin" ./shell.nix | |
| - name: Pull OCI chart from GHCR | |
| env: | |
| IMAGE_ORG: ${{ env.IMAGE_ORG }} | |
| RAW_TAG: v2.9.0 | |
| run: | | |
| TAG="${RAW_TAG#v}" | |
| echo "Using chart version: $TAG" | |
| rm -rf deploy/helm/charts | |
| mkdir -p charts-staged charts-final deploy/helm/charts | |
| CHART_REF=oci://ghcr.io/${IMAGE_ORG}/helm/zfs-localpv | |
| helm pull "$CHART_REF" \ | |
| --version "$TAG" \ | |
| --destination charts-staged | |
| tar -xzf charts-staged/zfs-localpv-"$TAG".tgz -C charts-final | |
| mv charts-final/zfs-localpv/* deploy/helm/charts | |
| - name: Set Chart Version | |
| run: | | |
| echo "VERSION=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml)" >> $GITHUB_ENV | |
| - name: Update the registry and the repository | |
| run: | | |
| nix-shell --pure --run "./scripts/update-reg-repo.sh --registry docker.io/ --repository ${{ env.IMAGE_ORG }}/zfs-driver" ./shell.nix | |
| - name: Publish chart via OCI | |
| uses: appany/[email protected] | |
| with: | |
| name: zfs-localpv | |
| repository: ${{ github.repository_owner }}/charts | |
| tag: ${{ env.VERSION }} | |
| path: ./deploy/helm/charts | |
| registry: ghcr.io | |
| registry_username: ${{ github.actor }} | |
| registry_password: ${{ secrets.GITHUB_TOKEN }} | |
| update_dependencies: 'false' |