diff --git a/.github/workflows/build-publish-docker-helm.yaml b/.github/workflows/build-publish-docker-helm.yaml new file mode 100644 index 0000000..c0a7edb --- /dev/null +++ b/.github/workflows/build-publish-docker-helm.yaml @@ -0,0 +1,47 @@ +name: Build and Publish Docker Images and Helm Chart + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + publish-charts: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install chartpress + run: pip install chartpress + + - name: Configure Git + run: | + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor }}@users.noreply.github.com" + + - name: Run chartpress + run: | + chartpress --push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::$(cat helm/jupyter-home-nfs/Chart.yaml | grep version | awk '{print $2}') + + - name: Package Helm Chart + run: | + helm package helm/jupyter-home-nfs -d .helm-charts + + - name: Push Helm Chart + run: | + helm push .helm-charts/jupyter-home-nfs-${{ steps.get_version.outputs.VERSION }}.tgz oci://ghcr.io/sunu/jupyter-home-nfs \ No newline at end of file diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml deleted file mode 100644 index ba851e7..0000000 --- a/.github/workflows/docker-build.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: Build and push container image - -on: - workflow_dispatch: - push: - branches: - - main - -env: - REGISTRY: ghcr.io - IMAGE_NAME: sunu/nfs-ganesha - -jobs: - build-and-push: - runs-on: ubuntu-latest - permissions: - contents: read - packages: write - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Log in to the container registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v3 - with: - install: true - - - name: Build and push container image - uses: docker/build-push-action@v6 - with: - context: ./nfs-ganesha - file: ./nfs-ganesha/Dockerfile - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.sha }}, ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest - labels: org.opencontainers.image.source="${{ github.repository }}" \ No newline at end of file