From c909666f118430120029ed3c54e2b5d56417c86a Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 13 Dec 2024 00:05:08 +0100 Subject: [PATCH] extend workflow for k8s manifest --- .github/workflows/buildAndRelease.yaml | 10 +++++++++- README.md | 8 ++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/buildAndRelease.yaml b/.github/workflows/buildAndRelease.yaml index cbc7dca..4f9e709 100644 --- a/.github/workflows/buildAndRelease.yaml +++ b/.github/workflows/buildAndRelease.yaml @@ -36,6 +36,14 @@ jobs: echo "VERSION=${VERSION}" >> $GITHUB_ENV echo Using name=$NAME and version=$VERSION + - name: Set up Node.js + uses: actions/setup-node@v4 + + - name: Build Kubernetes Manifest + run: | + npm install + node build.mjs k8s + - name: Set up Docker uses: docker/setup-buildx-action@v2 @@ -52,7 +60,7 @@ jobs: prerelease: false #body_path: CHANGELOG.md files: | - *.tgz + out/*k8s.yaml - name: Log in to GitHub Container Registry uses: docker/login-action@v3 diff --git a/README.md b/README.md index cb30d2c..94649bf 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ Simple WebApp (SPA) using [esbuild](https://esbuild.github.io/), [jsx-dom](https://www.npmjs.com/package/jsx-dom) and [tailwindcss](https://www.npmjs.com/package/tailwindcss) # 📑 Requirements -* [Docker](https://www.docker.com/) for building the image * [NodeJS](https://nodejs.org/) for developing the webapp -* [Helm](https://helm.sh/) for deploying to [Kubernetes](https://kubernetes.io/) +* [Docker](https://www.docker.com/) for building the image +* [kubectl](https://kubernetes.io/de/docs/reference/kubectl/) for deploying to [Kubernetes](https://kubernetes.io/) # 🏗️ Structure All source-files for the app resides in the `./src` folder. @@ -91,9 +91,9 @@ kubectl delete -f out/${NAME}.k8s.yaml --namespace $(namespace) # ⚙️ Github Release + Package Whenever a new commit is pushed on the `main` branch or a pull request is created, the Github workflow gets triggered. -The workflow (`./.github/workflows/buildAndRelease.yaml`) builds the app, Docker image and Helm chart. +The workflow (`./.github/workflows/buildAndRelease.yaml`) builds the app, Docker image and Kubernetes manifest. -To create a Github Release and publish the app, Docker image and Helm chart, +To create a Github Release and publish the app, Docker image and Kubernetes manifest, you only have to tag the specific commit with `*.*.*` notation ([SemanticVersion](https://semver.org/)). Just run `make release version=1.0.0` or following commands