From e6ca97d81acedd2ce67fdff880ed78a616cf4af6 Mon Sep 17 00:00:00 2001 From: devthejo Date: Mon, 19 Jun 2023 16:20:03 +0200 Subject: [PATCH] feat: ci on kontinuous --- .dockerignore | 3 ++ .github/workflows/deactivate.yaml | 23 +++++++++++ .github/workflows/deactivate.yml | 14 ------- .github/workflows/preproduction.yaml | 17 ++++++++ .github/workflows/preproduction.yml | 41 ------------------- .github/workflows/production.yaml | 16 ++++++++ .github/workflows/production.yml | 39 ------------------ .github/workflows/release.yaml | 15 +++++++ .github/workflows/release.yml | 28 ------------- .github/workflows/review-auto.yaml | 16 ++++++++ .github/workflows/review.yaml | 19 +++++++++ .github/workflows/review.yml | 38 ----------------- .kontinuous/config.yaml | 1 + .../monsuivipsy-site.sealed-secret.yaml | 0 .../env/dev/values.yaml | 0 .../monsuivipsy-site.sealed-secret.yaml | 0 .../env/preprod/values.yaml | 0 .../monsuivipsy-site.sealed-secret.yaml | 0 .../env/prod/values.yaml | 0 .../common => .kontinuous}/values.yaml | 2 +- .socialgouv.yaml | 0 21 files changed, 111 insertions(+), 161 deletions(-) create mode 100644 .github/workflows/deactivate.yaml delete mode 100644 .github/workflows/deactivate.yml create mode 100644 .github/workflows/preproduction.yaml delete mode 100644 .github/workflows/preproduction.yml create mode 100644 .github/workflows/production.yaml delete mode 100644 .github/workflows/production.yml create mode 100644 .github/workflows/release.yaml delete mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/review-auto.yaml create mode 100644 .github/workflows/review.yaml delete mode 100644 .github/workflows/review.yml create mode 100644 .kontinuous/config.yaml rename {.kube-workflow => .kontinuous}/env/dev/templates/monsuivipsy-site.sealed-secret.yaml (100%) rename {.kube-workflow => .kontinuous}/env/dev/values.yaml (100%) rename {.kube-workflow => .kontinuous}/env/preprod/templates/monsuivipsy-site.sealed-secret.yaml (100%) rename {.kube-workflow => .kontinuous}/env/preprod/values.yaml (100%) rename {.kube-workflow => .kontinuous}/env/prod/templates/monsuivipsy-site.sealed-secret.yaml (100%) rename {.kube-workflow => .kontinuous}/env/prod/values.yaml (100%) rename {.kube-workflow/common => .kontinuous}/values.yaml (97%) create mode 100644 .socialgouv.yaml diff --git a/.dockerignore b/.dockerignore index 7f2c6dd..f9dd342 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,3 +4,6 @@ *.md **/node_modules **/.next/cache +.kontinuous +.dockerignore +Dockerfile \ No newline at end of file diff --git a/.github/workflows/deactivate.yaml b/.github/workflows/deactivate.yaml new file mode 100644 index 0000000..9f6e3e2 --- /dev/null +++ b/.github/workflows/deactivate.yaml @@ -0,0 +1,23 @@ +name: ♻️ Deactivate +on: + pull_request: + types: [closed] + delete: + branches: + - "**" + - "!v*" + - "!master" + - "!main" + - "!dev" + - "!develop" + - "!**/persist" + - "!persist/**" + - "!**/persist/**" + - "!persist-**" + - "!**-persist" + - "!**-persist-**" + +jobs: + socialgouv: + uses: socialgouv/workflows/.github/workflows/use-ks-gh-deactivate.yaml@v1 + secrets: inherit diff --git a/.github/workflows/deactivate.yml b/.github/workflows/deactivate.yml deleted file mode 100644 index 23e7a12..0000000 --- a/.github/workflows/deactivate.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Deactivate - -on: - pull_request: - types: [ closed ] - -jobs: - bury_review_env: - name: Deactivate review branch - runs-on: ubuntu-latest - steps: - - uses: SocialGouv/actions/k8s-funeral@master - with: - kube-config: ${{ secrets.SOCIALGOUV_KUBE_CONFIG_DEV }} diff --git a/.github/workflows/preproduction.yaml b/.github/workflows/preproduction.yaml new file mode 100644 index 0000000..6623481 --- /dev/null +++ b/.github/workflows/preproduction.yaml @@ -0,0 +1,17 @@ +name: 😎 PreProd +on: + workflow_dispatch: + push: + branches: + - "master" + - "main" + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} + +jobs: + socialgouv: + name: "🇫🇷 SocialGouv" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-preproduction.yaml@v1 + secrets: inherit diff --git a/.github/workflows/preproduction.yml b/.github/workflows/preproduction.yml deleted file mode 100644 index b72241f..0000000 --- a/.github/workflows/preproduction.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Preproduction - -on: - push: - branches: - - master - tags-ignore: - - v* - -concurrency: - cancel-in-progress: true - group: preproduction - -jobs: - register: - name: Build & Register application - runs-on: ubuntu-latest - steps: - - name: Use autodevops build and register - uses: SocialGouv/actions/autodevops-build-register@v1 - with: - environment: preprod - imagePackage: app - token: ${{ secrets.GITHUB_TOKEN }} - - deploy: - name: Deploy application - runs-on: ubuntu-latest - needs: [register] - environment: - name: preproduction - url: https://monsuivipsy-site-preprod.dev.fabrique.social.gouv.fr - steps: - - name: Use kube-workflow deployment - uses: SocialGouv/kube-workflow@v1 - with: - environment: preprod - token: ${{ secrets.GITHUB_TOKEN }} - kubeconfig: ${{ secrets.KUBECONFIG }} - rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }} - rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }} diff --git a/.github/workflows/production.yaml b/.github/workflows/production.yaml new file mode 100644 index 0000000..3cae2d5 --- /dev/null +++ b/.github/workflows/production.yaml @@ -0,0 +1,16 @@ +name: 🚀 Production +on: + workflow_dispatch: + push: + tags: + - v* + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} + +jobs: + socialgouv: + name: "🇫🇷 SocialGouv" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-production.yaml@v1 + secrets: inherit diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml deleted file mode 100644 index 103d972..0000000 --- a/.github/workflows/production.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Production - -on: - push: - tags: - - v* - -concurrency: - group: production - cancel-in-progress: true - -jobs: - register: - name: Build & Register application - runs-on: ubuntu-latest - steps: - - name: Use autodevops build and register - uses: SocialGouv/actions/autodevops-build-register@v1 - with: - environment: prod - imagePackage: app - token: ${{ secrets.GITHUB_TOKEN }} - - deploy: - name: Deploy application - runs-on: ubuntu-latest - needs: [register] - environment: - name: production - url: https://monsuivipsy.fabrique.social.gouv.fr - steps: - - name: Use kube-workflow deployment - uses: SocialGouv/kube-workflow@v1 - with: - environment: prod - token: ${{ secrets.GITHUB_TOKEN }} - kubeconfig: ${{ secrets.KUBECONFIG }} - rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }} - rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..f36cb0a --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,15 @@ +name: Release +on: + workflow_dispatch: + push: + branches: [master, main, alpha, beta, next] +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - uses: socialgouv/workflows/actions/semantic-release@v1 + with: + github-token: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }} + author-name: ${{ secrets.SOCIALGROOVYBOT_NAME }} + author-email: ${{ secrets.SOCIALGROOVYBOT_EMAIL }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 8837d8c..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Release - -on: - workflow_dispatch: - push: - branches: [master, alpha, beta, next] - -jobs: - release: - name: Release - runs-on: ubuntu-latest - steps: - - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 0 - persist-credentials: false - - - name: Semantic Release - uses: cycjimmy/semantic-release-action@v2 - with: - semantic_version: 17 - extra_plugins: | - @semantic-release/changelog@5.0.1 - @semantic-release/git@9.0.0 - env: - GITHUB_TOKEN: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }} diff --git a/.github/workflows/review-auto.yaml b/.github/workflows/review-auto.yaml new file mode 100644 index 0000000..548cf4e --- /dev/null +++ b/.github/workflows/review-auto.yaml @@ -0,0 +1,16 @@ +name: 👓 Review Auto +on: + push: + branches: + - "feat/**" + - "fix/**" + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} + +jobs: + socialgouv: + name: "🇫🇷 SocialGouv" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-review-auto.yaml@v1 + secrets: inherit diff --git a/.github/workflows/review.yaml b/.github/workflows/review.yaml new file mode 100644 index 0000000..258abaf --- /dev/null +++ b/.github/workflows/review.yaml @@ -0,0 +1,19 @@ +name: 👀 Review +on: + push: + branches: + - "**" + - "!master" + - "!main" + - "!feat/**" + - "!fix/**" + +concurrency: + cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.ref }} + +jobs: + socialgouv: + name: "🇫🇷 SocialGouv" + uses: socialgouv/workflows/.github/workflows/use-ks-gh-review.yaml@v1 + secrets: inherit diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml deleted file mode 100644 index 8efbdc1..0000000 --- a/.github/workflows/review.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Review - -on: - push: - branches-ignore: - - master - tags-ignore: - - v* - -concurrency: - cancel-in-progress: true - group: review-${{ github.ref }} - -jobs: - register: - name: Build & Register application - runs-on: ubuntu-latest - steps: - - name: Use autodevops build and register - uses: SocialGouv/actions/autodevops-build-register@v1 - with: - environment: dev - imagePackage: app - token: ${{ secrets.GITHUB_TOKEN }} - - deploy: - name: Deploy review branch - runs-on: ubuntu-latest - needs: [register] - steps: - - name: Use kube-workflow deployment - uses: SocialGouv/kube-workflow@v1 - with: - environment: dev - token: ${{ secrets.GITHUB_TOKEN }} - kubeconfig: ${{ secrets.KUBECONFIG }} - rancherProjectId: ${{ secrets.RANCHER_PROJECT_ID }} - rancherProjectName: ${{ secrets.RANCHER_PROJECT_NAME }} diff --git a/.kontinuous/config.yaml b/.kontinuous/config.yaml new file mode 100644 index 0000000..6036e91 --- /dev/null +++ b/.kontinuous/config.yaml @@ -0,0 +1 @@ +projectName: monsuivipsy \ No newline at end of file diff --git a/.kube-workflow/env/dev/templates/monsuivipsy-site.sealed-secret.yaml b/.kontinuous/env/dev/templates/monsuivipsy-site.sealed-secret.yaml similarity index 100% rename from .kube-workflow/env/dev/templates/monsuivipsy-site.sealed-secret.yaml rename to .kontinuous/env/dev/templates/monsuivipsy-site.sealed-secret.yaml diff --git a/.kube-workflow/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml similarity index 100% rename from .kube-workflow/env/dev/values.yaml rename to .kontinuous/env/dev/values.yaml diff --git a/.kube-workflow/env/preprod/templates/monsuivipsy-site.sealed-secret.yaml b/.kontinuous/env/preprod/templates/monsuivipsy-site.sealed-secret.yaml similarity index 100% rename from .kube-workflow/env/preprod/templates/monsuivipsy-site.sealed-secret.yaml rename to .kontinuous/env/preprod/templates/monsuivipsy-site.sealed-secret.yaml diff --git a/.kube-workflow/env/preprod/values.yaml b/.kontinuous/env/preprod/values.yaml similarity index 100% rename from .kube-workflow/env/preprod/values.yaml rename to .kontinuous/env/preprod/values.yaml diff --git a/.kube-workflow/env/prod/templates/monsuivipsy-site.sealed-secret.yaml b/.kontinuous/env/prod/templates/monsuivipsy-site.sealed-secret.yaml similarity index 100% rename from .kube-workflow/env/prod/templates/monsuivipsy-site.sealed-secret.yaml rename to .kontinuous/env/prod/templates/monsuivipsy-site.sealed-secret.yaml diff --git a/.kube-workflow/env/prod/values.yaml b/.kontinuous/env/prod/values.yaml similarity index 100% rename from .kube-workflow/env/prod/values.yaml rename to .kontinuous/env/prod/values.yaml diff --git a/.kube-workflow/common/values.yaml b/.kontinuous/values.yaml similarity index 97% rename from .kube-workflow/common/values.yaml rename to .kontinuous/values.yaml index 5a59d1a..3690d39 100644 --- a/.kube-workflow/common/values.yaml +++ b/.kontinuous/values.yaml @@ -1,5 +1,5 @@ app: - enabled: true + containerPort: 3000 probesPath: /api/healthz envFrom: - secretRef: diff --git a/.socialgouv.yaml b/.socialgouv.yaml new file mode 100644 index 0000000..e69de29