-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
54 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.dockerignore | ||
node_modules | ||
storybook-static | ||
.npmrc | ||
dist | ||
.idea |
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 |
---|---|---|
|
@@ -4,10 +4,10 @@ on: | |
branches: [main] | ||
|
||
jobs: | ||
build: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
name: Run build on push main | ||
name: Run test on push main | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Node.js | ||
|
@@ -27,3 +27,27 @@ jobs: | |
"npx http-server storybook-static --port 6006 --silent" \ | ||
"npx wait-on tcp:6006 && pnpm cypress:run" | ||
- run: pnpm run build | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: test | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up SSH | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.DEV_SSH_PRIVATE_KEY }} | ||
|
||
- name: Deploy to Server | ||
env: | ||
DEPLOY_USER: ${{ secrets.DEV_SSH_USER }} | ||
DEPLOY_HOST: ${{ secrets.DEV_SSH_HOST }} | ||
DEPLOY_PATH: ${{ secrets.DEV_SSH_DEPLOY_PATH }} | ||
run: | | ||
echo $DEPLOY_PATH | ||
ssh-keyscan $DEPLOY_HOST >> ~/.ssh/known_hosts | ||
rsync -avz -e "ssh -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o BatchMode=yes" --rsync-path="TERM=xterm rsync" $GITHUB_WORKSPACE/ $DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH | ||
ssh -o LogLevel=ERROR -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o BatchMode=yes $DEPLOY_USER@$DEPLOY_HOST "cd $DEPLOY_PATH && (docker stop storybook-build || true) && (docker rm storybook-build || true) && docker build -t storybook-build . && docker run -d -p 6006:6006 --name storybook-build storybook-build" |
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,18 @@ | ||
FROM node:lts-alpine | ||
|
||
WORKDIR /app | ||
|
||
RUN npm install -g pnpm | ||
RUN npm install -g serve | ||
|
||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
RUN pnpm install | ||
|
||
COPY . . | ||
|
||
RUN pnpm run build-storybook | ||
|
||
EXPOSE 6006 | ||
|
||
CMD ["npx", "serve", "-l", "6006", "storybook-static"] |