diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 4e9ae50..99a65d5 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -24,14 +24,18 @@ jobs: - name: Build project run: npm run build + - name: Copy SSH key + run: | + echo "${{ secrets.EC2_KEY }}" > key.pem + chmod 600 key.pem + - name: Deploy to EC2 env: EC2_HOST: ${{ secrets.EC2_HOST }} EC2_USER: ${{ secrets.EC2_USER }} - EC2_KEY: ${{ secrets.EC2_KEY }} run: | - ssh -o StrictHostKeyChecking=no -i $EC2_KEY $EC2_USER@$EC2_HOST << 'EOF' + ssh -o StrictHostKeyChecking=no -i key.pem ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF' cd /home/ubuntu/ethora-docs chmod +x deploy.sh ./deploy.sh -EOF \ No newline at end of file + EOF