fix : radius #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: DICE FRONTEND CI/CD | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
DEPLOY: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup Node.js and Yarn | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
registry-url: 'https://registry.yarnpkg.com' | |
cache: yarn | |
- name: Install dependencies | |
run: | | |
yarn install --frozen-lockfile | |
- name: Build React app | |
run: | | |
yarn build:dev | |
- name: Initialize Known Hosts | |
run: | | |
mkdir -p ~/.ssh | |
touch ~/.ssh/known_hosts | |
ssh-keyscan ${{ secrets.EC2_HOST_DEV }} >> ~/.ssh/known_hosts | |
- name: Set Permissions for Private Key | |
run: | | |
echo "${{ secrets.DEPLOY_SSH_KEY }}" > $HOME/key.pem | |
chmod 400 $HOME/key.pem | |
- name: Copy to ubuntu | |
env: | |
SSH_PEM_KEY: ${{ secrets.DEPLOY_SSH_KEY }} | |
run: | | |
scp -i $HOME/key.pem -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null dist/* ubuntu@${{ secrets.EC2_HOST_DEV }}:/www/var/html |