Skip to content

Commit

Permalink
[CI] Update CI action
Browse files Browse the repository at this point in the history
- update actions to latest version
- adding cache mechanisme for node_modules
- deploy website
  • Loading branch information
sim51 committed Apr 9, 2024
1 parent e04ceaa commit 540a390
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 5 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/osrd-ui-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: 'https://registry.npmjs.org/'
- run: |
node-version: '20'

- name: Cache node_modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Build project
run: |
npm ci
npm run build
6 changes: 6 additions & 0 deletions .github/workflows/osrd-ui-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Cache node_modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Publish
run: |
VERSION=${GITHUB_REF/refs\/tags\//}
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/osrd-ui-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish @osrd-project website

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest

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

- uses: actions/setup-node@v4
with:
node-version: '20'

- name: Cache node_modules
uses: actions/cache@v4
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/package-lock.json') }}

- name: Build
run: |
npm ci
npm run build
- name: Deploy to GitHub Pages
uses: crazy-max/ghaction-github-pages@v2
with:
target_branch: gh-pages
build_dir: packages/storybook/storybook-static
jekyll: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 540a390

Please sign in to comment.