We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c7865e commit 34a614aCopy full SHA for 34a614a
.github/workflows/deploy.yml
@@ -0,0 +1,32 @@
1
+name: Deploy Frontend to EC2
2
+
3
+on:
4
+ push:
5
+ branches:
6
+ - main
7
8
+jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
12
+ steps:
13
+ - name: Checkout repo
14
+ uses: actions/checkout@v4
15
16
+ - name: Setup SSH key
17
+ uses: webfactory/ssh-agent@v0.7.0
18
+ with:
19
+ ssh-private-key: ${{ secrets.EC2_SSH_KEY }}
20
21
+ - name: Deploy Frontend to EC2
22
+ run: |
23
+ ssh -o StrictHostKeyChecking=no ${{ secrets.EC2_USERNAME }}@${{ secrets.EC2_HOST }} -p ${{ secrets.EC2_PORT }} << 'EOF'
24
+ cd /home/ec2-user/easyToFind-Frontend
25
26
+ echo "NEXT_PUBLIC_API_BASE_URL=${{ secrets.NEXT_PUBLIC_API_BASE_URL }}" > .env.local
27
+ git pull origin main
28
29
+ pnpm install
30
+ pnpm build
31
+ pm2 restart easytofind-frontend
32
+ EOF
0 commit comments