Skip to content

Commit

Permalink
ci: bump various actions and build with node 20 (#25)
Browse files Browse the repository at this point in the history
Also configure dependabot to update the GitHub Actions.
  • Loading branch information
benjaminParisel committed Apr 15, 2024
1 parent 020b39e commit 3ea0c35
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 53 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion .github/workflows/deploy-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
paths:
- 'cli/**/*'
- 'site/**/*'
- '.github/actions/build-setup/**/*'
- '.github/workflows/deploy-pr-preview.yml'

jobs:
Expand All @@ -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
Expand Down
59 changes: 13 additions & 46 deletions .github/workflows/publish-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
paths:
- 'cli/**/*'
- 'site/**/*'
- '.github/actions/build-setup/**/*'
- '.github/workflows/publish-production.yml'

permissions:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}?check_suite_focus=true| here>"
}
},
{
"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 <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}?check_suite_focus=true| here>
8 changes: 4 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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]
====
Expand Down
1 change: 1 addition & 0 deletions cli/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20

0 comments on commit 3ea0c35

Please sign in to comment.