-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #241 from woowa-techcamp-2021/develop
1.0.0
- Loading branch information
Showing
335 changed files
with
16,892 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: Production Server CD | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
jobs: | ||
backend: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
PATTERNS: | | ||
src/**/*.+(ts|tsx) | ||
FILES: | | ||
package.json | ||
RELATIVE: "server" | ||
- name: Configure SSH | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
echo "$SSH_KEY" > ~/.ssh/production.key | ||
chmod 600 ~/.ssh/production.key | ||
cat >>~/.ssh/config <<END | ||
Host production | ||
HostName $SSH_HOST | ||
User $SSH_USER | ||
IdentityFile ~/.ssh/production.key | ||
StrictHostKeyChecking no | ||
END | ||
env: | ||
SSH_HOST: ${{ secrets.HOSTNAME }} | ||
SSH_USER: ${{ secrets.USERNAME }} | ||
SSH_KEY: ${{ secrets.PRIVATE_KEY }} | ||
- name: Checkout and Pull origin | ||
run: ssh production 'cd ~/store-4 && git checkout main && git pull origin' | ||
|
||
- name: if changed dependencies, install dependencies | ||
run: ssh production 'cd ~/store-4/server && npm i' | ||
if: env.MATCHED_FILES | ||
|
||
- name: Reload Pm2 | ||
run: ssh production 'cd ~/store-4/server && npm run build && sudo pm2 reload store-4' | ||
if: env.GIT_DIFF | ||
frontend: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: technote-space/get-diff-action@v4 | ||
with: | ||
PATTERNS: | | ||
client/src/**/*.+(ts|tsx) | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Configure SSH | ||
run: | | ||
mkdir -p ~/.ssh/ | ||
echo "$SSH_KEY" > ~/.ssh/production.key | ||
chmod 600 ~/.ssh/production.key | ||
cat >>~/.ssh/config <<END | ||
Host production | ||
HostName $SSH_HOST | ||
User $SSH_USER | ||
IdentityFile ~/.ssh/production.key | ||
StrictHostKeyChecking no | ||
END | ||
env: | ||
SSH_HOST: ${{ secrets.HOSTNAME }} | ||
SSH_USER: ${{ secrets.USERNAME }} | ||
SSH_KEY: ${{ secrets.PRIVATE_KEY }} | ||
- name: Touch .env file | ||
run: | | ||
cat >>./.env <<END | ||
SERVER_URL=${{ secrets.SERVER_URL }} | ||
END | ||
working-directory: client | ||
- name: Run build script && Sync build files to server | ||
run: cd client && npm i && npm run build && rsync -avz ./dist/ production:~/store-4/client/dist | ||
if: env.GIT_DIFF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: NodeJS CI - compile | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [14.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use NodeJS ${{ matrix.node-version }} | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- run: npm ci | ||
working-directory: client | ||
- run: npx tsc | ||
working-directory: client | ||
|
||
- run: npm ci | ||
working-directory: server | ||
- run: npx tsc | ||
working-directory: server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,24 @@ | ||
{ | ||
"presets": ["@babel/preset-env", "@babel/preset-react", "@babel/preset-typescript"] | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { "browsers": ["last 2 versions", "ie >= 11"] }, | ||
"useBuiltIns": "entry", | ||
"corejs": "3.16" | ||
} | ||
], | ||
"@babel/preset-react", | ||
"@babel/preset-typescript" | ||
], | ||
"plugins": [ | ||
["@babel/plugin-proposal-decorators", { "legacy": true }], | ||
[ | ||
"@babel/plugin-transform-runtime", | ||
{ | ||
"corejs": 3, | ||
"regenerator": true | ||
} | ||
] | ||
] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = { | ||
testEnvironment: 'jsdom', | ||
moduleNameMapper: { | ||
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg)$': 'jest-transform-stub', | ||
'.+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2|svg|gif)$': 'jest-transform-stub', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
declare module '*.png'; | ||
declare module '*.jpg'; | ||
declare module '*.svg'; | ||
declare module '*.gif'; | ||
declare module '*.mp4'; | ||
declare module '*.webm'; |
Oops, something went wrong.