Skip to content

Commit

Permalink
chore: Add github actions to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Aug 6, 2024
1 parent bbd619d commit 764d1ef
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 244 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Deploy Cozy-ui
on: pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
# - run: yarn add puppeteer@"21.11.0" -DE --ignore-scripts
- name: Install packages
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Generate Sprite and Palette
run: yarn makeSpriteAndPalette
- name: Build JS
run: yarn build
- name: Build CSS
run: yarn build:css:all
- name: Build docs
run: |
yarn build:doc:react
yarn build:doc:kss
# - name: Tests without snapshots
# run: yarn test:noSnapshots
# - name: Tests snapshots
# run: yarn test:snapshots
# - name: Bundlemon
# run: yarn bundlemon
- name: Argos - Prepare env
run: mkdir ./screenshots
# - run: npx puppeteer browsers install chrome
# - run: cd node_modules/puppeteer/ && yarn exec node install.mjs
- name: Argos - Create desktop screenshots
run: yarn screenshots --mode react --viewport desktop --screenshot-dir ./screenshots/reactDesktop
- name: Argos - Create mobile screenshots
run: yarn screenshots --mode react --viewport 300x600 --screenshot-dir ./screenshots/reactMobile
- name: Argos - Create kss screenshots
run: yarn screenshots --mode kss --screenshot-dir ./screenshots/kss
- name: Argos - Upload all screenshots
run: |
yarn argos:upload --parallel screenshots/reactDesktop/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_JOB --ignore ''
yarn argos:upload --parallel screenshots/reactMobile/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_JOB --ignore ''
yarn argos:upload --parallel screenshots/kss/ --token $ARGOS_TOKEN --parallel-total 3 --parallel-nonce $GITHUB_JOB --ignore ''
182 changes: 0 additions & 182 deletions .travis.yml

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
"postcss-loader": "2.1.6",
"pretty": "2.0.0",
"prop-types": "15.7.2",
"puppeteer": "21.6.1",
"puppeteer-core": "21.11.0",
"react": "16.12.0",
"react-dom": "16.12.0",
"react-hot-loader": "^4.3.11",
Expand Down Expand Up @@ -185,7 +185,6 @@
"cozy-harvest-lib": "^6.7.3",
"cozy-intent": ">=1.3.0",
"cozy-sharing": ">=14.1.0",
"puppeteer": "^1.20.0",
"react": "^16.8.6",
"react-dom": "^16.8.6"
},
Expand Down
2 changes: 1 addition & 1 deletion scripts/screenshots.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { readConfig, parseViewportArgument } = require('./screenshots/helpers')

let puppeteer
try {
puppeteer = require('puppeteer')
puppeteer = require('puppeteer-core')
} catch (e) {
console.error(e)
console.log(
Expand Down
Loading

0 comments on commit 764d1ef

Please sign in to comment.