Skip to content

Commit

Permalink
fix: deploy to IPFS automatically (#4397)
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin authored May 2, 2024
1 parent 89bd284 commit 754066c
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ipfs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ipfs

on:
push:
tags: [v*]
tags: [cowswap-v*]

env:
REACT_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
Expand Down
4 changes: 1 addition & 3 deletions apps/cowswap-frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
"author": "",
"license": "ISC",
"scripts": {
"ipfs:build": "cross-env PUBLIC_URL=\".\" yarn build",
"ipfs:publish": "npx ipfs-deploy build -p pinata -O",
"patch-package": "npx patch-package",
"cosmos:clear": "rm -rf ./public/cosmos",
"cosmos:run": "yarn run _cosmos:run",
Expand All @@ -32,4 +30,4 @@
"dependencies": {},
"devDependencies": {},
"nx": {}
}
}
63 changes: 52 additions & 11 deletions apps/cowswap-frontend/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@
"targets": {
"build": {
"executor": "@nx/vite:build",
"outputs": ["{options.outputPath}"],
"outputs": [
"{options.outputPath}"
],
"defaultConfiguration": "production",
"dependsOn": ["i18n"],
"dependsOn": [
"i18n"
],
"options": {
"outputPath": "build/cowswap"
},
Expand Down Expand Up @@ -60,11 +64,38 @@
"jestConfig": "apps/cowswap-frontend/jest.config.ts"
}
},
"build:ipfs": {
"executor": "nx:run-commands",
"options": {
"commands": [
{
"command": "export PUBLIC_URL=\".\""
},
{
"command": "nx run cowswap-frontend:build"
}
],
"parallel": false
}
},
"ipfs": {
"executor": "nx:run-commands",
"dependsOn": [
"build:ipfs"
],
"options": {
"command": "npx ipfs-deploy build/cowswap -p pinata -O"
}
},
"lint": {
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"outputs": [
"{options.outputFile}"
],
"options": {
"lintFilePatterns": ["apps/cowswap-frontend/**/*.{ts,tsx,js,jsx}"]
"lintFilePatterns": [
"apps/cowswap-frontend/**/*.{ts,tsx,js,jsx}"
]
}
},
"serve-static": {
Expand All @@ -73,24 +104,34 @@
"buildTarget": "cowswap-frontend:build"
}
},

"i18n": {
"executor": "nx:run-commands",
"dependsOn": ["i18n:extract"],
"dependsOn": [
"i18n:extract"
],
"options": {
"command": "npx lingui compile"
},
"inputs": ["{projectRoot}/src/locales/*.po"],
"outputs": ["{projectRoot}/src/locales/*.js"]
"inputs": [
"{projectRoot}/src/locales/*.po"
],
"outputs": [
"{projectRoot}/src/locales/*.js"
]
},
"i18n:extract": {
"executor": "nx:run-commands",
"options": {
"command": "cross-env NODE_ENV=development npx lingui extract --locale en-US"
},
"inputs": ["{workspaceRoot}/apps/**/*.{ts,tsx,jsx}", "{workspaceRoot}/libs/**/*.{ts,tsx,jsx}"],
"outputs": ["{projectRoot}/src/locales/*.po"]
"inputs": [
"{workspaceRoot}/apps/**/*.{ts,tsx,jsx}",
"{workspaceRoot}/libs/**/*.{ts,tsx,jsx}"
],
"outputs": [
"{projectRoot}/src/locales/*.po"
]
}
},
"tags": []
}
}

0 comments on commit 754066c

Please sign in to comment.