Skip to content

Commit

Permalink
fix: Migration de la documentation technique (#2711)
Browse files Browse the repository at this point in the history
* move specs and test action
* add PR template
* merge openapi v3.1 files
* test deploy on working branch
* validate swagger
* proofread API v3.1 spec
* set deployment to releases only in github action
* try-out x-topics
  • Loading branch information
jonathanfallon authored Dec 2, 2024
1 parent 2955a72 commit a96a39e
Show file tree
Hide file tree
Showing 6 changed files with 4,700 additions and 9 deletions.
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#fixes (issues)

## Description

<!-- compléter ici -->

## Checklist

- [ ] [j'ai suivi les guidelines du "clean code"](https://gist.github.com/wojteklu/73c6914cc446146b8b533c0988cf8d29)
- [ ] [j'ai mis à jour la documentation technique](https://www.notion.so/Documentation-technique-du-Registre-de-preuve-de-covoiturage-14b994bec93180f98a89da28aff88f32)
- [ ] ajout ou mise à jour des tests unitaires
- [ ] ajout ou mise à jour des tests d'intégration

## Merge

Je squash la PR et vérifie que le message de commit utilise
[la convention d'Angular](https://github.com/angular/angular/blob/main/CONTRIBUTING.md#-commit-message-format) :

```
<type>(<scope>): <short summary>
│ │ │
│ │ └─⫸ Summary in present tense. Not capitalized. No period at the end.
│ │
│ └─⫸ Commit Scope: proxy|acquisition|export|...
└─⫸ Commit Type: build|ci|docs|feat|fix|perf|refactor|test
```
Types de commit

- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (examples: Github Actions)
- docs: Documentation only changes
- feat: A new feature (Minor bump)
- fix: A bug fix (Patch bump)
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- test: Adding missing tests or correcting existing tests

Le _scope_ (optionnel) précise le module ou le composant impacté par le commit.
10 changes: 1 addition & 9 deletions .github/workflows/deploy-frontends-many.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
matrix:
env: [demo, production]
project_name: [attestation, dashboard, techdoc]
project_name: [attestation, dashboard]
include:
- project_name: attestation
build_directory: attestation
Expand All @@ -39,11 +39,3 @@ jobs:
dist_directory: dashboard/dist/dashboard
bucket_name_var: DASHBOARD_BUCKET_NAME
cache_dependency_path: dashboard/package-lock.json
- project_name: techdoc
build_directory: doc
build_command: |
npm run gen
NODE_OPTIONS=--openssl-legacy-provider npm run build
dist_directory: doc/dist
bucket_name_var: TECHDOC_BUCKET_NAME
cache_dependency_path: doc/package-lock.json
50 changes: 50 additions & 0 deletions .github/workflows/deploy-techdoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Deploy API documentation
permissions:
contents: read
on:
workflow_dispatch:
release:
types: [published]
push:
branches:
- chore/add-bump-action
jobs:
deploy-doc:
name: Deploy
runs-on: ubuntu-latest

# add files here
strategy:
matrix:
include:
- doc: api
version: v3.1
token: BUMP_TOKEN_API
- doc: api
version: v3.0
token: BUMP_TOKEN_API

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Verify OpenAPI files
run: |
file="api/specs/${{ matrix.doc }}-${{ matrix.version }}.yaml"
if [ ! -f "$file" ]; then
echo "Error: $file does not exist"
exit 1
fi
- name: Validate OpenAPI syntax
uses: swaggerexpert/swagger-editor-validate@v1
with:
definition-file: api/specs/${{ matrix.doc }}-${{ matrix.version }}.yaml

- name: Deploy
uses: bump-sh/github-action@v1
with:
doc: ${{ matrix.doc }}
token: ${{ secrets[matrix.token] }}
file: api/specs/${{ matrix.doc }}-${{ matrix.version }}.yaml
branch: ${{ matrix.version }}
Loading

0 comments on commit a96a39e

Please sign in to comment.