test: test ci #1
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: | |
| - 'rel-test' | |
| jobs: | |
| release-images-and-chart: | |
| runs-on: ubuntu-latest | |
| 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: ${{ github.ref_name }} | |
| 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/localpv-provisioner | |
| helm pull "$CHART_REF" \ | |
| --version "$TAG" \ | |
| --destination charts-staged | |
| tar -xzf charts-staged/localpv-provisioner-"$TAG".tgz -C charts-final | |
| mv charts-final/localpv-provisioner/* deploy/helm/charts | |
| - name: Set Chart Version | |
| run: | | |
| echo "VERSION=$(awk -F': ' '/^version:/ {print $2}' deploy/helm/charts/Chart.yaml)" >> $GITHUB_ENV | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Login to Quay | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_USERNAME }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - name: Login to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Update the registry and the repository | |
| run: | | |
| nix-shell --pure --run "./scripts/update-reg-repo.sh --repository ${{ env.IMAGE_ORG }}/provisioner-localpv" ./shell.nix | |
| - uses: appany/[email protected] | |
| with: | |
| name: localpv-provisioner | |
| 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' |