-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
3,792 additions
and
8,291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,22 +13,20 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- run: | | ||
node -e "const pkg = require('./package.json'); pkg.version = '$RELEASE_VERSION'; require('fs').writeFileSync('./package.json', JSON.stringify(pkg, null, ' '), 'utf8')" | ||
node -e "const pkg = require('./front/package.json'); pkg.version = '$RELEASE_VERSION'; require('fs').writeFileSync('./front/package.json', JSON.stringify(pkg, null, ' '), 'utf8')" | ||
node -e "const pkg = require('./graphql/package.json'); pkg.version = '$RELEASE_VERSION'; require('fs').writeFileSync('./graphql/package.json', JSON.stringify(pkg, null, ' '), 'utf8')" | ||
npm i --package-lock-only | ||
npm i --prefix=graphql --package-lock-only | ||
npm i --prefix=front --package-lock-only | ||
RELEASE_GIT_NAME=$(curl -s https://api.github.com/users/$GITHUB_ACTOR | jq -r .name) | ||
[email protected] | ||
git config --local user.name "$RELEASE_GIT_NAME" | ||
git config --local user.email "$RELEASE_GIT_EMAIL" | ||
git commit -a -m "Release $RELEASE_VERSION" | ||
git tag "v$RELEASE_VERSION" | ||
git push origin master | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,21 +17,13 @@ First step is to clone the project, you can use either the HTTPS or SSH version | |
$ git clone [email protected]:EcrituresNumeriques/stylo.git | ||
|
||
|
||
Stylo uses submodules to pull templates (and those templates are hosted on framagit). | ||
If you have an account with ssh enabled on framagit, you can pull all submodules using the following commands: | ||
|
||
|
||
$ git submodule init | ||
$ git submodule update | ||
|
||
|
||
## Run with Docker | ||
|
||
Useful to run a fully fledged Stylo in no time. | ||
|
||
Run the following command: | ||
|
||
$ cp stylo-example.env stylo.env | ||
$ cp stylo-example.env .env | ||
$ docker-compose up | ||
|
||
**NOTE:** The first time, this command can take a few dozen minutes depending on your network speed and machine capabilities. Subsequent calls will be faster. | ||
|
@@ -58,7 +50,7 @@ We provide a working configuration example below for the Nginx server. | |
|
||
After _cloning_ the repo, build the service and its dependencies: | ||
|
||
$ cp stylo-example.env stylo.env | ||
$ cp stylo-example.env .env | ||
$ npm clean-install | ||
$ npm start | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Release | ||
|
||
Cette page explique comment créer une nouvelle release de Stylo et comment la déployer sur https://stylo.huma-num.fr/. | ||
Pour rappel, l'ensemble des changements qui arrivent sur la branche principale (i.e., `master`) sont déployés automatiquement sur https://stylo-dev.huma-num.fr/. | ||
|
||
# Pré-requis | ||
|
||
- Avoir un compte GitHub | ||
- Avoir les droits d'écriture sur le projet GitHub [EcrituresNumeriques/stylo](https://github.com/EcrituresNumeriques/stylo) | ||
- Avoir les droits de lancer le workflow [release](https://github.com/EcrituresNumeriques/stylo/actions/workflows/release.yml) | ||
|
||
## Créer une nouvelle release | ||
|
||
- Aller sur la page https://github.com/EcrituresNumeriques/stylo/actions/workflows/release.yml et cliquer sur le bouton "Run workflow". | ||
- Une fenêtre s'ouvre et propose de renseigner une branche ainsi qu'un numéro de version : | ||
![projet/release-run-workflow.png](projet/release-run-workflow.png) | ||
|
||
- Laisser la branche principale (i.e., `master`) sélectionnée et renseigner une version (sans suffixe). | ||
Par exemple : `3.4.5`. | ||
- Cliquer sur le bouton vert "Run workflow" | ||
|
||
Une nouvelle ligne va s'afficher dans la liste. Vous pouvez voir le détail en cliquant sur la ligne : | ||
|
||
![projet/release-workflow-success.png](projet/release-workflow-success.png) | ||
|
||
Le workflow se compose de deux étapes principales : | ||
- release | ||
- modifie la version dans les fichiers `package.json` (`package-lock.json`) | ||
- commit les changements | ||
- crée un tag à partir de la version renseignée lors du lancement du workflow | ||
- call-build-deploy-docker | ||
- construit et déploie les images Docker sur le registre ghcr.io | ||
- https://github.com/EcrituresNumeriques/stylo/pkgs/container/stylo-graphql | ||
- https://github.com/EcrituresNumeriques/stylo/pkgs/container/stylo-front | ||
- https://github.com/EcrituresNumeriques/stylo/pkgs/container/stylo-export | ||
|
||
> [!NOTE] | ||
> À noter que cette deuxième étape peut être lancée manuellement puisqu'elle repose sur le workflow [docker](https://github.com/EcrituresNumeriques/stylo/actions/workflows/docker.yml). | ||
Une fois ce workflow terminé, vous devriez avoir une nouvelle version des images Docker dans le registre ghcr.io. | ||
|
||
## Déployer une version en production | ||
|
||
Le déploiement en production nécessite une action manuelle. | ||
|
||
> [!NOTE] | ||
> Si vous souhaitez déployer une nouvelle release, assurez-vous que la nouvelle version des images Docker `stylo-graphql`, `stylo-front` et `stylo-export` disponibles sur le registre ghcr.io. | ||
Une fois la version des images disponibles sur ghcr.io, vous pouvez lancer le workflow [deploy](https://github.com/EcrituresNumeriques/stylo/actions/workflows/deploy-tag.yml). | ||
De la même façon que pour le workflow de release, cliquer sur le bouton "Run workflow". | ||
Laisser la branche principale (i.e., `master`) sélectionnée et renseigner la version à déployer (sans suffixe). Par exemple : `3.4.5`. | ||
|
||
Une nouvelle ligne va s'afficher dans la liste. Vous pouvez voir le détail en cliquant sur la ligne : | ||
|
||
![projet/deploy.png](projet/deploy.png) | ||
|
||
Une fois le déploiement terminé en succès, vous pouvez vous rendre sur https://stylo.huma-num.fr/ afin de vérifier que la version est bien déployée. | ||
Le numéro de version s'affiche dans le pied de page : | ||
|
||
![projet/stylo-home.png](projet/stylo-home.png) | ||
|
||
Ici, la version déployée est la version 3.1.5. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.