-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.24 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Deployment Dev
on:
push:
branches:
- main
jobs:
build-and-deploy:
name: Build and Deployment
runs-on: ubuntu-20.04
permissions:
packages: write
contents: read
attestations: write
steps:
# Deploy to Server
- name: SSH & Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.TESTNET_FRONTEND_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.FRONTEND_SSH_KEY }}
script: |
#!/usr/bin/env bash
cd launchpad
sudo git checkout main;
sudo git pull origin main;
echo "Stopping and removing specific service: launchpad_main"
sudo docker-compose stop launchpad_main
sudo docker-compose rm -f launchpad_main
echo "Removing dangling images"
sudo docker rmi $(sudo docker images -f "dangling=true" -q) || true
sudo docker build -t autlabs/launchpad:main . --build-arg ENV_FILE=.env
# sudo docker push autlabs/launchpad:main
echo "Pulling the new image"
# sudo docker-compose pull launchpad_main
docker-compose up -d --build launchpad_main
exit 0;