Skip to content

Commit a6d1dcd

Browse files
committed
Merge pull request #4 from Newella-HQ/deploy-job
deploy job
2 parents 3402681 + 494f552 commit a6d1dcd

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/deploy.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Deploy
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
deploy:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout
10+
uses: actions/checkout@v4
11+
12+
- name: SSH and run commands
13+
env:
14+
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY}}
15+
run: |
16+
# copy SSH private key and set rights
17+
echo "$PRIVATE_KEY" > private_key.pem
18+
chmod 600 private_key.pem
19+
20+
# connect to server
21+
ssh -o StrictHostKeyChecking=no -i private_key.pem [email protected] <<EOF
22+
23+
cd ~/newella/newella-backend
24+
git checkout main
25+
git pull
26+
make up
27+
28+
EOF
29+
30+
rm -f private_key.pem
31+
permissions:
32+
contents: read
33+
actions: write
34+
id-token: write
35+
36+

0 commit comments

Comments
 (0)