From 9c5a914e43d56b306e21301b4c4c65cf14f9e57b Mon Sep 17 00:00:00 2001 From: Kirill K Date: Fri, 15 Dec 2023 13:26:28 +0300 Subject: [PATCH] feat: publish charts (#43) * chore: move chart * chore: add chart publish action * fix: env vars * fix: env vars, take 2 * chore: test * chore: test, take 2 * chore: test, take 3 * chore: test, take 4 * chore: test, take 5 * chore: test, take 6 * chore: test, take 7 * chore: test, take 8 * chore: test, take 9 * chore: test, take 10 * chore: test, take 11 * chore: test, take 12 * chore: test, take 13 * chore: test, take 14 * chore: test, take 15 * chore: test, take 16 * chore: test, take 17 * chore: test, take 18 * chore: trigger ci * chore: test * chore: test, take 2 * chore: test, take 3 * chore: test, take 4 * chore: trigger ci * chore: test * feat: add gh-pages update * chore: trigger ci * docs: update * chore: update * chore: rename files --- .../{backend.yaml => build-backend.yaml} | 0 .../{frontend.yaml => build-frontend.yaml} | 0 .github/workflows/deploy-gh-pages.yaml | 46 +++++++++++++++++++ .github/workflows/release-chart.yaml | 30 ++++++++++++ README.md | 5 +- {deploy/helm => charts}/pagetron/.helmignore | 0 {deploy/helm => charts}/pagetron/Chart.yaml | 0 .../templates/backend.deployment.yaml | 0 .../pagetron/templates/backend.service.yaml | 0 .../templates/blackbox.deployment.yaml | 0 .../pagetron/templates/blackbox.service.yaml | 0 .../templates/frontend.deployment.yaml | 0 .../pagetron/templates/frontend.service.yaml | 0 .../templates/housekeeper.configmap.yaml | 0 .../templates/housekeeper.cronjob.yaml | 0 .../templates/prometheus.configmap.yaml | 0 .../templates/prometheus.deployment.yaml | 0 .../pagetron/templates/prometheus.pvc.yaml | 0 .../templates/prometheus.service.yaml | 0 .../templates/tests/test-connection.yaml | 0 {deploy/helm => charts}/pagetron/values.yaml | 0 21 files changed, 78 insertions(+), 3 deletions(-) rename .github/workflows/{backend.yaml => build-backend.yaml} (100%) rename .github/workflows/{frontend.yaml => build-frontend.yaml} (100%) create mode 100644 .github/workflows/deploy-gh-pages.yaml create mode 100644 .github/workflows/release-chart.yaml rename {deploy/helm => charts}/pagetron/.helmignore (100%) rename {deploy/helm => charts}/pagetron/Chart.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/backend.deployment.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/backend.service.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/blackbox.deployment.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/blackbox.service.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/frontend.deployment.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/frontend.service.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/housekeeper.configmap.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/housekeeper.cronjob.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/prometheus.configmap.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/prometheus.deployment.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/prometheus.pvc.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/prometheus.service.yaml (100%) rename {deploy/helm => charts}/pagetron/templates/tests/test-connection.yaml (100%) rename {deploy/helm => charts}/pagetron/values.yaml (100%) diff --git a/.github/workflows/backend.yaml b/.github/workflows/build-backend.yaml similarity index 100% rename from .github/workflows/backend.yaml rename to .github/workflows/build-backend.yaml diff --git a/.github/workflows/frontend.yaml b/.github/workflows/build-frontend.yaml similarity index 100% rename from .github/workflows/frontend.yaml rename to .github/workflows/build-frontend.yaml diff --git a/.github/workflows/deploy-gh-pages.yaml b/.github/workflows/deploy-gh-pages.yaml new file mode 100644 index 0000000..a4455f2 --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yaml @@ -0,0 +1,46 @@ +--- + +name: Deploy static content to Pages + +on: + push: + branches: + - gh-pages + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + runs-on: ubuntu-latest + + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Pages + uses: actions/configure-pages@v4 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + # Upload entire repository + path: '.' + + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v3 diff --git a/.github/workflows/release-chart.yaml b/.github/workflows/release-chart.yaml new file mode 100644 index 0000000..a331192 --- /dev/null +++ b/.github/workflows/release-chart.yaml @@ -0,0 +1,30 @@ +--- + +name: helm chart + +on: + push: + branches: + - master + paths: + - "charts/pagetron/**" + +jobs: + release: + name: Release Chart + + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Publish Helm charts + uses: stefanprodan/helm-gh-pages@v1.7.0 + with: + token: ${{ secrets.CR_TOKEN }} diff --git a/README.md b/README.md index 62b9995..7511aba 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,9 @@ You must have Kubernetes cluster to be up and running to deploy this application At the moment, installation is as simple as: ``` -git clone https://github.com/agrrh/pagetron.git +helm repo add pagetron https://agrrh.github.io/pagetron/ -helm install pagetron \ - pagetron/deploy/helm/pagetron \ +helm install my-status-page pagetron/pagetron \ --upgrade \ --namespace pagetron \ --values values.yaml diff --git a/deploy/helm/pagetron/.helmignore b/charts/pagetron/.helmignore similarity index 100% rename from deploy/helm/pagetron/.helmignore rename to charts/pagetron/.helmignore diff --git a/deploy/helm/pagetron/Chart.yaml b/charts/pagetron/Chart.yaml similarity index 100% rename from deploy/helm/pagetron/Chart.yaml rename to charts/pagetron/Chart.yaml diff --git a/deploy/helm/pagetron/templates/backend.deployment.yaml b/charts/pagetron/templates/backend.deployment.yaml similarity index 100% rename from deploy/helm/pagetron/templates/backend.deployment.yaml rename to charts/pagetron/templates/backend.deployment.yaml diff --git a/deploy/helm/pagetron/templates/backend.service.yaml b/charts/pagetron/templates/backend.service.yaml similarity index 100% rename from deploy/helm/pagetron/templates/backend.service.yaml rename to charts/pagetron/templates/backend.service.yaml diff --git a/deploy/helm/pagetron/templates/blackbox.deployment.yaml b/charts/pagetron/templates/blackbox.deployment.yaml similarity index 100% rename from deploy/helm/pagetron/templates/blackbox.deployment.yaml rename to charts/pagetron/templates/blackbox.deployment.yaml diff --git a/deploy/helm/pagetron/templates/blackbox.service.yaml b/charts/pagetron/templates/blackbox.service.yaml similarity index 100% rename from deploy/helm/pagetron/templates/blackbox.service.yaml rename to charts/pagetron/templates/blackbox.service.yaml diff --git a/deploy/helm/pagetron/templates/frontend.deployment.yaml b/charts/pagetron/templates/frontend.deployment.yaml similarity index 100% rename from deploy/helm/pagetron/templates/frontend.deployment.yaml rename to charts/pagetron/templates/frontend.deployment.yaml diff --git a/deploy/helm/pagetron/templates/frontend.service.yaml b/charts/pagetron/templates/frontend.service.yaml similarity index 100% rename from deploy/helm/pagetron/templates/frontend.service.yaml rename to charts/pagetron/templates/frontend.service.yaml diff --git a/deploy/helm/pagetron/templates/housekeeper.configmap.yaml b/charts/pagetron/templates/housekeeper.configmap.yaml similarity index 100% rename from deploy/helm/pagetron/templates/housekeeper.configmap.yaml rename to charts/pagetron/templates/housekeeper.configmap.yaml diff --git a/deploy/helm/pagetron/templates/housekeeper.cronjob.yaml b/charts/pagetron/templates/housekeeper.cronjob.yaml similarity index 100% rename from deploy/helm/pagetron/templates/housekeeper.cronjob.yaml rename to charts/pagetron/templates/housekeeper.cronjob.yaml diff --git a/deploy/helm/pagetron/templates/prometheus.configmap.yaml b/charts/pagetron/templates/prometheus.configmap.yaml similarity index 100% rename from deploy/helm/pagetron/templates/prometheus.configmap.yaml rename to charts/pagetron/templates/prometheus.configmap.yaml diff --git a/deploy/helm/pagetron/templates/prometheus.deployment.yaml b/charts/pagetron/templates/prometheus.deployment.yaml similarity index 100% rename from deploy/helm/pagetron/templates/prometheus.deployment.yaml rename to charts/pagetron/templates/prometheus.deployment.yaml diff --git a/deploy/helm/pagetron/templates/prometheus.pvc.yaml b/charts/pagetron/templates/prometheus.pvc.yaml similarity index 100% rename from deploy/helm/pagetron/templates/prometheus.pvc.yaml rename to charts/pagetron/templates/prometheus.pvc.yaml diff --git a/deploy/helm/pagetron/templates/prometheus.service.yaml b/charts/pagetron/templates/prometheus.service.yaml similarity index 100% rename from deploy/helm/pagetron/templates/prometheus.service.yaml rename to charts/pagetron/templates/prometheus.service.yaml diff --git a/deploy/helm/pagetron/templates/tests/test-connection.yaml b/charts/pagetron/templates/tests/test-connection.yaml similarity index 100% rename from deploy/helm/pagetron/templates/tests/test-connection.yaml rename to charts/pagetron/templates/tests/test-connection.yaml diff --git a/deploy/helm/pagetron/values.yaml b/charts/pagetron/values.yaml similarity index 100% rename from deploy/helm/pagetron/values.yaml rename to charts/pagetron/values.yaml