From a0f7bb74264ed4155e3e107a6f9400c523a3a208 Mon Sep 17 00:00:00 2001 From: devthejo Date: Tue, 23 May 2023 14:38:17 +0200 Subject: [PATCH] feat: ci on kontinuous --- .github/workflows/deactivate.yaml | 23 +++++++++++ .github/workflows/deactivate.yml | 15 ------- .github/workflows/preproduction.yaml | 17 ++++++++ .github/workflows/preproduction.yml | 43 --------------------- .github/workflows/production.yaml | 16 ++++++++ .github/workflows/production.yml | 42 -------------------- .github/workflows/release.yml | 14 +++---- .github/workflows/review-auto.yaml | 16 ++++++++ .github/workflows/review.yaml | 19 +++++++++ .github/workflows/review.yml | 41 -------------------- .kontinuous/env/dev/values.yaml | 5 +++ .kontinuous/env/preprod/values.yaml | 4 ++ .kontinuous/env/prod/values.yaml | 5 +++ {.kube-workflow => .kontinuous}/values.yaml | 2 +- .kube-workflow/prod/values.yaml | 2 - .socialgouv.yaml | 0 16 files changed, 112 insertions(+), 152 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/review-auto.yaml create mode 100644 .github/workflows/review.yaml delete mode 100644 .github/workflows/review.yml create mode 100644 .kontinuous/env/dev/values.yaml create mode 100644 .kontinuous/env/preprod/values.yaml create mode 100644 .kontinuous/env/prod/values.yaml rename {.kube-workflow => .kontinuous}/values.yaml (56%) delete mode 100644 .kube-workflow/prod/values.yaml create mode 100644 .socialgouv.yaml 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 e5b28b6..0000000 --- a/.github/workflows/deactivate.yml +++ /dev/null @@ -1,15 +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/autodevops-deactivate@v1 - with: - kube-config: ${{ secrets.KUBECONFIG }} - github-token: ${{ secrets.GITHUB_TOKEN }} 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 1deb085..0000000 --- a/.github/workflows/preproduction.yml +++ /dev/null @@ -1,43 +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 }} - dockerbuildargs: | - NEXT_PUBLIC_API_URL=https://backoffice-1000jours-preprod.dev.fabrique.social.gouv.fr - - deploy: - name: Deploy application - runs-on: ubuntu-latest - needs: [register] - environment: - name: preproduction - url: https://1000jours-blues-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 31d3c15..0000000 --- a/.github/workflows/production.yml +++ /dev/null @@ -1,42 +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 }} - dockerbuildargs: | - NEXT_PUBLIC_INSTAGRAM_TOKEN=instagram_token_prod - NEXT_PUBLIC_API_URL=https://backoffice-les1000jours.fabrique.social.gouv.fr - - deploy: - name: Deploy application - runs-on: ubuntu-latest - needs: [register] - environment: - name: production - url: https://1000jours-blues.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.yml b/.github/workflows/release.yml index fa77fde..f36cb0a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,17 +1,15 @@ name: Release - on: workflow_dispatch: push: - branches: [master, alpha, beta, next] - + branches: [master, main, alpha, beta, next] jobs: release: name: Release runs-on: ubuntu-latest steps: - - uses: SocialGouv/actions/autodevops-release@v1 - with: - author-name: ${{ secrets.SOCIALGROOVYBOT_NAME }} - author-email: ${{ secrets.SOCIALGROOVYBOT_EMAIL }} - github-token: ${{ secrets.SOCIALGROOVYBOT_BOTO_PAT }} + - 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/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 d4eda31..0000000 --- a/.github/workflows/review.yml +++ /dev/null @@ -1,41 +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 }} - dockerbuildargs: | - NEXT_PUBLIC_INSTAGRAM_TOKEN=instagram_token_dev - NEXT_PUBLIC_API_URL=https://backoffice-1000jours-preprod.dev.fabrique.social.gouv.fr - - 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/env/dev/values.yaml b/.kontinuous/env/dev/values.yaml new file mode 100644 index 0000000..4174b1a --- /dev/null +++ b/.kontinuous/env/dev/values.yaml @@ -0,0 +1,5 @@ +jobs: + runs: + build-app: + NEXT_PUBLIC_INSTAGRAM_TOKEN: instagram_token_dev + NEXT_PUBLIC_API_URL: https://backoffice-1000jours-preprod.dev.fabrique.social.gouv.fr \ No newline at end of file diff --git a/.kontinuous/env/preprod/values.yaml b/.kontinuous/env/preprod/values.yaml new file mode 100644 index 0000000..c900295 --- /dev/null +++ b/.kontinuous/env/preprod/values.yaml @@ -0,0 +1,4 @@ +jobs: + runs: + build-app: + NEXT_PUBLIC_API_URL: https://backoffice-1000jours-preprod.dev.fabrique.social.gouv.fr \ No newline at end of file diff --git a/.kontinuous/env/prod/values.yaml b/.kontinuous/env/prod/values.yaml new file mode 100644 index 0000000..999b68e --- /dev/null +++ b/.kontinuous/env/prod/values.yaml @@ -0,0 +1,5 @@ +jobs: + runs: + build-app: + NEXT_PUBLIC_INSTAGRAM_TOKEN: instagram_token_prod + NEXT_PUBLIC_API_URL: https://backoffice-les1000jours.fabrique.social.gouv.fr \ No newline at end of file diff --git a/.kube-workflow/values.yaml b/.kontinuous/values.yaml similarity index 56% rename from .kube-workflow/values.yaml rename to .kontinuous/values.yaml index 7332ccd..36cade0 100644 --- a/.kube-workflow/values.yaml +++ b/.kontinuous/values.yaml @@ -1,3 +1,3 @@ app: - enabled: True + containerPort: 3000 probesPath: /healthz diff --git a/.kube-workflow/prod/values.yaml b/.kube-workflow/prod/values.yaml deleted file mode 100644 index 9dca501..0000000 --- a/.kube-workflow/prod/values.yaml +++ /dev/null @@ -1,2 +0,0 @@ -app: - certSecretName: 1000jours-blues-crt diff --git a/.socialgouv.yaml b/.socialgouv.yaml new file mode 100644 index 0000000..e69de29