diff --git a/.github/actions/build-setup/action.yml b/.github/actions/build-setup/action.yml index 888158e..50a7dda 100644 --- a/.github/actions/build-setup/action.yml +++ b/.github/actions/build-setup/action.yml @@ -4,9 +4,9 @@ runs: using: "composite" steps: - name: Setup node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: '18' + node-version-file: 'cli/.nvmrc' cache: 'npm' cache-dependency-path: cli/package-lock.json - name: Install dependencies diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..3acd08e --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# See https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates +version: 2 +updates: + - package-ecosystem: "github-actions" + # Workflow files stored in the default location of `.github/workflows` + directory: "/" + schedule: + interval: "weekly" + day: "friday" + time: "05:00" + open-pull-requests-limit: 2 diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml index f0b863d..b432668 100644 --- a/.github/workflows/deploy-pr-preview.yml +++ b/.github/workflows/deploy-pr-preview.yml @@ -6,6 +6,7 @@ on: paths: - 'cli/**/*' - 'site/**/*' + - '.github/actions/build-setup/**/*' - '.github/workflows/deploy-pr-preview.yml' jobs: @@ -15,7 +16,7 @@ jobs: pull-requests: write # surge-preview creates or updates PR comments about the deployment status steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Setup uses: ./.github/actions/build-setup - run: npm --prefix ./cli run test diff --git a/.github/workflows/publish-production.yml b/.github/workflows/publish-production.yml index aa6d51c..f8ea38d 100644 --- a/.github/workflows/publish-production.yml +++ b/.github/workflows/publish-production.yml @@ -10,6 +10,7 @@ on: paths: - 'cli/**/*' - 'site/**/*' + - '.github/actions/build-setup/**/*' - '.github/workflows/publish-production.yml' permissions: @@ -21,7 +22,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Build Setup uses: ./.github/actions/build-setup - run: npm --prefix ./cli run test @@ -36,7 +37,7 @@ jobs: run: echo "deploy_message=Deploy ${{ github.sha }}" >> $GITHUB_ENV - name: Deploy to Netlify - uses: nwtgck/actions-netlify@v1.2 + uses: nwtgck/actions-netlify@v2.1 with: publish-dir: './build/' production-deploy: true @@ -51,48 +52,14 @@ jobs: NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} timeout-minutes: 10 - name: Send message to Slack channel - if: failure() - uses: slackapi/slack-github-action@v1.23.0 + if: ${{ failure() }} + uses: bonitasoft/notify-slack-action@v1 with: - channel-id: 'CCQGMR4ES' - payload: | - { - "blocks": [ - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": ":red_circle: Publish rest api documentation in production failed. \n \n @channel *We need someone* !" - } - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "More details about the error " - } - }, - { - "type": "divider" - }, - { - "type": "section", - "text": { - "type": "mrkdwn", - "text": "_C’est pas grave de faire des erreurs. Par contre il ne faut pas les merger!_ :imp:" - } - }, - { - "type": "context", - "elements": [ - { - "type": "plain_text", - "text": "Author: Adrien L.", - "emoji": true - } - ] - } - ] - } - env: - SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} + keeper-secret-config: ${{ secrets.KSM_CONFIG }} + channel-id: CCQGMR4ES + message: | + :red_circle: Publish rest api documentation in production failed. + + @channel *We need someone* ! + + More details about the error diff --git a/README.adoc b/README.adoc index b6da6e6..58031c4 100644 --- a/README.adoc +++ b/README.adoc @@ -20,15 +20,15 @@ This project contains the sources of https://bonita-api-doc.netlify.app/[Bonita A basic CLI based on NodeJS (`cli/restdoc-site.js`) is used to build the site. It is based on http://yargs.js.org/[yargs] project and expose the following commands : -- `clean` : delete previous build output -- `build` : generate the static site to deploy in specified output directory (default to ./build) +- `clean`: delete previous build output +- `build`: generate the static site to deploy in specified output directory (default to ./build) == Requirements -{url-node}[Node 18.x] (may work with newer versions, no guarantee). +{url-node}[Node 20.x] (may work with newer versions, no guarantee). While you can install Node from the official packages, we strongly recommend that you use {url-nvm}[nvm] (Node Version Manager) to install and manage Node. -Follow the {url-nvm-install}[nvm installation instructions] to set up nvm on your machine. Then run `nvm use`. +Follow the {url-nvm-install}[nvm installation instructions] to set up nvm on your machine. Go the `cli` folder, then run `nvm use`. [NOTE] ==== diff --git a/cli/.nvmrc b/cli/.nvmrc new file mode 100644 index 0000000..209e3ef --- /dev/null +++ b/cli/.nvmrc @@ -0,0 +1 @@ +20