Skip to content

Commit

Permalink
✨ [Feature] Update docker-cd.yml (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyeoni committed Aug 22, 2023
1 parent 59ae80e commit 11cd1a8
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/docker-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Continuous Deployment

on:
push:
branches:
- main

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build and push Docker Compose services
run: |
docker compose -f docker-compose.yml build
docker compose -f docker-compose.yml push
- name: Deploy to Server
run: |
ssh-keyscan ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts
echo "${{ secrets.SERVER_SSH_KEY }}" > ${{ secrets.EC2_KEY }}
chmod 600 ${{ secrets.EC2_KEY }}
scp docker-compose.yml ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }}:~/docker-compose.yml
ssh -i ${{ secrets.EC2_KEY }} ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} "docker compose -f ~/docker-compose.yml pull && docker compose -f ~/docker-compose.yml up -d"
4 changes: 3 additions & 1 deletion backend/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# env files
.env
.env*
!.env.example


# seeding result
/seeding/results
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ services:
container_name: ghostserver
depends_on:
- db
image: server
image: skdusdl8804/ghostserver
env_file:
- ./backend/.env
build:
context: .
dockerfile: ./backend/Dockerfile
Expand All @@ -29,7 +31,7 @@ services:
container_name: ghostclient
depends_on:
- server
image: client
image: skdusdl8804/ghostclient
build:
context: .
dockerfile: ./frontend/Dockerfile
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/assets/svgs/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed frontend/src/assets/svgs/google.png
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/src/pages/PrePage/PrePage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { GameButton, Grid, IconButton, Text } from '@/common';
import { ReactComponent as Logo } from '@/svgs/logo-lg.svg';
import { ReactComponent as GoogleIcon } from '@/svgs/google.svg';
import { ReactComponent as GithubIcon } from '@/svgs/github-sm.svg';
import { ReactComponent as GithubIcon } from '@/svgs/github.svg';
import { ReactComponent as FourtyTwoIcon } from '@/svgs/42.svg';

export const PrePage = () => {
Expand Down

0 comments on commit 11cd1a8

Please sign in to comment.