Skip to content

Fetch all branches from remote repository #10

Fetch all branches from remote repository

Fetch all branches from remote repository #10

name: Deploy test server to ec2
on:
push:
branches:
- refact/issue-533-continued
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Print workspace directory
run: echo $GITHUB_WORKSPACE
- name: Checkout Repository
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: executing remote ssh commands using ssh key
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TEST_HOST }} # 인스턴스 IP
username: ${{ secrets.TEST_USERNAME }} # 우분투 아이디
key: ${{ secrets.TEST_PEM_KEY }} # ec2 instance pem key
port: 22
script: |
cp ~/config-injection/ecosystem-${{ env.SERVER_PROFILE }}.json ${{ env.PROJECT_PATH }}/ecosystem.json &&
cp ~/config-injection/envs/.env.${{ env.NODE_ENV }} ${{ env.PROJECT_PATH }}/.env &&
cd ${{ env.PROJECT_PATH }} &&
git fetch --all &&
git checkout ${{ env.BRANCH_NAME }} &&
git reset --hard origin/${{ env.BRANCH_NAME }} &&
git pull origin ${{ env.BRANCH_NAME }} &&
bash script/prebuild.sh &&
bash script/reload.sh
env:
BRANCH_NAME: refact/issue-533-continued
NODE_ENV: development
SERVER_PROFILE: development
PROJECT_PATH: ~/development