Skip to content
This repository has been archived by the owner on May 19, 2024. It is now read-only.

[WEAV-44] ๐Ÿ‘ท CD ํ”„๋กœ์„ธ์Šค ๊ตฌํ˜„ #10

Merged
merged 4 commits into from
Jan 23, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions .github/workflows/cd_dev.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CD - Dev

on: workflow_dispatch

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Copy Docker Compose file to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.DEV_INSTANCE_HOST }}
username: ${{ secrets.DEV_INSTANCE_USERNAME }}
key: ${{ secrets.DEV_INSTANCE_PEM_KEY }}
source: "./bootstrap/http/compose-dev.yaml"
target: "~"
dojinyou marked this conversation as resolved.
Show resolved Hide resolved
overwrite: true

- name: Install Docker if not present
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEV_INSTANCE_HOST }}
username: ${{ secrets.DEV_INSTANCE_USERNAME }}
key: ${{ secrets.DEV_INSTANCE_PEM_KEY }}
script: |
if ! command -v docker >/dev/null 2>&1; then
echo "Installing Docker..."
sudo apt-get update
sudo apt-get install -y docker.io
else
echo "Docker already installed."
fi

if ! command -v docker-compose >/dev/null 2>&1; then
echo "Installing Docker Compose..."
sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
else
echo "Docker Compose already installed."
fi

- name: Run Docker Compose up
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_INSTANCE_HOST }}
username: ${{ secrets.DEV_INSTANCE_USERNAME }}
key: ${{ secrets.DEV_INSTANCE_PEM_KEY }}
script: |
sudo docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }}
sudo docker-compose -f ~/bootstrap/http/compose-dev.yaml up -d
dojinyou marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 2 additions & 2 deletions .github/workflows/ci_dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
build-and-push:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Check Out Repository
Expand All @@ -30,7 +30,7 @@ jobs:
REGISTRY: ${{ steps.login-ecr-public.outputs.registry }}
REGISTRY_ALIAS: h3l4i6v1
REPOSITORY: weave_server_dev_cr
IMAGE_TAG: ${{ github.sha }}
IMAGE_TAG: latest
run: |
docker build -f Dockerfile-http -t $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG .
docker push $REGISTRY/$REGISTRY_ALIAS/$REPOSITORY:$IMAGE_TAG
Expand Down
2 changes: 2 additions & 0 deletions bootstrap/http/compose-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
DB_PASSWORD: secret
depends_on:
- mysql
ports:
- "80:80"
Comment on lines +12 to +13
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์š”๊ฑฐ cd ์ •์ƒ์ž‘๋™ํ•˜๋ฉด https๋กœ ๋Œ๋ฆด๊ฒŒ์š”

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ํ…Œ์„ญ์€ tls ํ•„์š”์—†์œผ๋ ค๋‚˜?

mysql:
image: mysql:8.0.33
environment:
Expand Down