Skip to content

Commit

Permalink
Merge #67: github actions 테스트
Browse files Browse the repository at this point in the history
test: #66 github actions 테스트
  • Loading branch information
yaongmeow authored Nov 21, 2023
2 parents 9851236 + 9552f7d commit 6b08eb5
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: CI

on:
push:
branches: [be-develop, main]

jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: Checkout...
- uses: actions/checkout@v3

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

- name: Install package
run: |
cd BE
npm ci
- name: Build
run: npm run start


deploy:
- name: Docker Login
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PASSWORD }}

- name: Build Docker
run: |
docker build -f Dockerfile -t traveline-docker ./BE
- name: Push Docker
run: docker push traveline/traveline-repo:latest

- name: SSH Login
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_IP }}
username: ${{ secrets.SERVER_USERNAME }}
password: ${{ secrets.SERVER_PASSWORD }}
script: |
docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PASSWORD }}
docker pull traveline/traveline-repo
docker stop traveline-docker || true
docker rm traveline-docker || true
docker run -e DB_HOST=${{ secrets.DB_HOST }} -e DB_PORT=${{ secrets.DB_PORT }} -e DB_USER=${{ secrets.DB_USER }} -e DB_PASSWORD=${{ secrets.DB_PASSWORD }} -e DB_DATABASE=${{ secrets.DB_DATABASE }} -e AWST_ACCESS_KEY=${{ secrets.AWS_ACCESS_KEY }} -e AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }} -e AWS_REGION=${{ secrets.AWS_REGION }} -d -p 4817:3000 --name travline-docker traveline/traveline-repo

0 comments on commit 6b08eb5

Please sign in to comment.