Skip to content

Commit

Permalink
Merge pull request #33 from Martinelli-3535/Jungwoo/Detail
Browse files Browse the repository at this point in the history
Jungwoo/Complete
  • Loading branch information
milk717 authored Feb 26, 2024
2 parents 758956c + 6d28e81 commit 7f3ed94
Show file tree
Hide file tree
Showing 75 changed files with 2,751 additions and 2,754 deletions.
119 changes: 60 additions & 59 deletions .github/workflows/prod-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,73 +1,74 @@
name: Docker CD

on:
push:
branches:
- 'production'
tags:
- 'v*'
pull_request:
branches:
- 'production'
push:
branches:
- 'production'
tags:
- 'v*'
pull_request:
branches:
- 'production'

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '18.x'

- name: Make env
run: |
touch ./.env
echo "${{ secrets.ENV }}" > ./.env
echo .env
shell: sh
- name: Make env
run: |
touch ./.env
echo "${{ secrets.ENV }}" > ./.env
echo .env
shell: sh

- name: Install dependencies
run: yarn
- name: Install dependencies
run: yarn

- name: Build Project
run: yarn build
- name: Build Project
run: yarn build

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ secrets.DOCKER_USERNAME }}/home-appcenter
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ secrets.DOCKER_USERNAME }}/home-appcenter
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}

- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
docker stop inu-hompage
docker rm inu-hompage
docker pull ${{ secrets.DOCKER_USERNAME }}/home-appcenter:production
docker run -d —name inu-hompage -p 3000:3000 ${{ secrets.DOCKER_USERNAME }}/home-appcenter:production
- name: Deploy
uses: appleboy/ssh-action@v0.1.7
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PASSWORD }}
script: |
docker stop inu-hompage
docker rm inu-hompage
docker pull ${{ secrets.DOCKER_USERNAME }}/home-appcenter:production
docker run -d --name inu-hompage -p 3000:3000 ${{ secrets.DOCKER_USERNAME }}/home-appcenter:production
# docker image prune -f
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
# production
/build

# git
appcenter-homepage-renewal.git/

# misc
.DS_Store
.env
Expand Down
1 change: 0 additions & 1 deletion appcenter-homepage-renewal.git/HEAD

This file was deleted.

8 changes: 0 additions & 8 deletions appcenter-homepage-renewal.git/config

This file was deleted.

1 change: 0 additions & 1 deletion appcenter-homepage-renewal.git/description

This file was deleted.

15 changes: 0 additions & 15 deletions appcenter-homepage-renewal.git/hooks/applypatch-msg.sample

This file was deleted.

24 changes: 0 additions & 24 deletions appcenter-homepage-renewal.git/hooks/commit-msg.sample

This file was deleted.

174 changes: 0 additions & 174 deletions appcenter-homepage-renewal.git/hooks/fsmonitor-watchman.sample

This file was deleted.

8 changes: 0 additions & 8 deletions appcenter-homepage-renewal.git/hooks/post-update.sample

This file was deleted.

14 changes: 0 additions & 14 deletions appcenter-homepage-renewal.git/hooks/pre-applypatch.sample

This file was deleted.

Loading

0 comments on commit 7f3ed94

Please sign in to comment.