Skip to content

Commit

Permalink
Merge pull request #2388 from betagouv/fix/cms_deploy
Browse files Browse the repository at this point in the history
Fix: cms deploy + meilisearch
  • Loading branch information
Datayama38 authored Jan 29, 2024
2 parents dd905c9 + 104f359 commit e1a86cc
Show file tree
Hide file tree
Showing 13 changed files with 124 additions and 107 deletions.
47 changes: 23 additions & 24 deletions .github/workflows/deploy-cms.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
value: ${{ steps.set_tag.outputs.value }}
steps:
- id: set_tag
run: echo "::set-output name=value::$(date +'%F.%H%M')"
run: echo "value=$(date +'%F.%H%M')" >> $GITHUB_OUTPUT

build:
needs: tag
Expand All @@ -33,26 +33,25 @@ jobs:
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}

# TODO
# deploy:
# name: Deploy
# needs: [tag, build]
# runs-on: ubuntu-latest
# steps:
# - name: Trigger Workflow
# uses: actions/github-script@v6
# env:
# TARGET_VERSION: ${{ needs.tag.outputs.value }}
# with:
# github-token: ${{ secrets.GA_PDC_TOKEN }}
# script: |
# github.rest.actions.createWorkflowDispatch({
# owner: context.repo.owner,
# repo: 'preuve-covoiturage-infra',
# workflow_id: 'deploy.yml',
# ref: 'main',
# inputs: {
# cms_version: process.env.TARGET_VERSION,
# },
# })
deploy:
name: Deploy
needs: [tag, build]
runs-on: ubuntu-latest
steps:
- name: Trigger Workflow
uses: actions/github-script@v6
env:
TARGET_VERSION: ${{ needs.tag.outputs.value }}
with:
github-token: ${{ secrets.GA_PDC_TOKEN }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'preuve-covoiturage-infra',
workflow_id: 'deploy.yml',
ref: 'main',
inputs: {
version: process.env.TARGET_VERSION,
image: 'strapi'
},
})
2 changes: 1 addition & 1 deletion cms/config/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default ({ env }) => ({
},
},
flags: {
nps: env.bool('FLAG_NPS', true),
nps: env.bool('FLAG_NPS', false),
promoteEE: env.bool('FLAG_PROMOTE_EE', false),
},
});
8 changes: 7 additions & 1 deletion cms/config/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ export default ({ env }) => ({
},
},
},
});
meilisearch: {
config: {
host: env('MEILISEARCH_HOST'),
apiKey: env('MEILISEARCH_MASTER_KEY'),
}
}
});
32 changes: 32 additions & 0 deletions cms/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions cms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react-router-dom": "^5.3.4",
"strapi-plugin-meilisearch": "^0.10.0",
"styled-components": "^5.3.3"
},
"strapi": {
Expand Down
10 changes: 4 additions & 6 deletions cms/src/api/article/content-types/article/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
"type": "string",
"required": true
},
"slug": {
"type": "string",
"required": true,
"unique": true,
"regex": "^([a-zA-Z-]*)$"
},
"description": {
"type": "text",
"required": true
Expand All @@ -45,6 +39,10 @@
"relation": "manyToOne",
"target": "api::categorie.categorie",
"inversedBy": "articles"
},
"slug": {
"type": "uid",
"targetField": "title"
}
}
}
9 changes: 4 additions & 5 deletions cms/src/api/categorie/content-types/categorie/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@
"type": "string",
"required": true
},
"slug": {
"type": "string",
"required": true,
"regex": "^([a-zA-Z-]*)$"
},
"articles": {
"type": "relation",
"relation": "oneToMany",
"target": "api::article.article",
"mappedBy": "categorie"
},
"slug": {
"type": "uid",
"targetField": "label"
}
}
}
52 changes: 36 additions & 16 deletions cms/src/api/page/content-types/page/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,49 @@
"type": "string",
"required": true
},
"sections": {
"tags": {
"type": "relation",
"relation": "manyToMany",
"target": "api::tag.tag",
"inversedBy": "pages"
},
"hero": {
"type": "component",
"repeatable": false,
"component": "page.hero"
},
"block": {
"type": "component",
"repeatable": false,
"component": "page.block"
},
"content": {
"type": "richtext",
"required": false
},
"rows": {
"type": "dynamiczone",
"components": [
"page.hero",
"page.block",
"shared.button",
"page.content",
"page.row",
"page.list",
"page.resource"
"row.analyse",
"row.graph",
"row.indicator",
"row.map"
]
},
"slug": {
"type": "string",
"regex": "^([a-zA-Z-]*)$",
"unique": true,
"required": true
},
"tags": {
"resources": {
"type": "relation",
"relation": "manyToMany",
"target": "api::tag.tag",
"target": "api::resource.resource",
"inversedBy": "pages"
},
"list": {
"type": "component",
"repeatable": false,
"component": "page.list"
},
"slug": {
"type": "uid",
"targetField": "title"
}
}
}
16 changes: 10 additions & 6 deletions cms/src/api/resource/content-types/resource/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,23 @@
"type": "string",
"required": true
},
"slug": {
"type": "string",
"required": true,
"unique": true,
"regex": "^([a-zA-Z-]*)$"
},
"content": {
"type": "richtext",
"required": true
},
"public_date": {
"type": "date",
"required": true
},
"pages": {
"type": "relation",
"relation": "manyToMany",
"target": "api::page.page",
"mappedBy": "resources"
},
"slug": {
"type": "uid",
"targetField": "title"
}
}
}
13 changes: 6 additions & 7 deletions cms/src/api/tag/content-types/tag/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"info": {
"singularName": "tag",
"pluralName": "tags",
"displayName": "Tag"
"displayName": "Tag",
"description": ""
},
"options": {
"draftAndPublish": false
Expand All @@ -16,17 +17,15 @@
"unique": false,
"required": true
},
"slug": {
"type": "string",
"regex": "^([a-zA-Z-]*)$",
"unique": true,
"required": true
},
"pages": {
"type": "relation",
"relation": "manyToMany",
"target": "api::page.page",
"mappedBy": "tags"
},
"slug": {
"type": "uid",
"targetField": "label"
}
}
}
12 changes: 0 additions & 12 deletions cms/src/components/page/content.json

This file was deleted.

14 changes: 0 additions & 14 deletions cms/src/components/page/resource.json

This file was deleted.

15 changes: 0 additions & 15 deletions cms/src/components/page/row.json

This file was deleted.

0 comments on commit e1a86cc

Please sign in to comment.