Skip to content

Commit 2a6adf0

Browse files
committed
Test workflow to SSH into EC2
1 parent 6300007 commit 2a6adf0

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/deploy-dev.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Test deploy on EC2
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up SSH
17+
run: |
18+
mkdir -p ~/.ssh
19+
echo "${{ secrets.EC2_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
20+
chmod 600 ~/.ssh/id_rsa
21+
ssh-keyscan -H ${{ secrets.EC2_HOST }} >> ~/.ssh/known_hosts
22+
23+
- name: Deploy to EC2
24+
run: |
25+
ssh ${{ secrets.EC2_USER }}@${{ secrets.EC2_HOST }} << 'EOF'
26+
set -e
27+
cd /data/FEActionsTest/
28+
29+
echo "Pulling latest changes..."
30+
git pull origin dev
31+
32+
echo "Creating test dir"
33+
mkdir test/
34+
35+
EOF

0 commit comments

Comments
 (0)