Skip to content

Commit c69cdb2

Browse files
committed
deployment
1 parent b521234 commit c69cdb2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/prod.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Production DigitalOcean Deploy
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build-and-deploy:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout Repository
13+
uses: actions/checkout@v3
14+
15+
- name: Log in to Docker Hub
16+
uses: docker/login-action@v2
17+
with:
18+
username: ${{ secrets.DOCKER_USERNAME }}
19+
password: ${{ secrets.DOCKER_PASSWORD }}
20+
21+
- name: Build and push image
22+
env:
23+
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
24+
run: |
25+
echo "Building and pushing docker image"
26+
docker build -t $DOCKER_USERNAME/autoplan-python:latest .
27+
docker push $DOCKER_USERNAME/autoplan-python:latest
28+
29+
- name: Deploy to DigitalOcean
30+
uses: appleboy/ssh-action@master
31+
with:
32+
host: ${{ secrets.SEREVR_HOST }}
33+
username: ${{ secrets.SERVER_USERNAME }}
34+
key: ${{ secrets.SERVER_SSH_KEY }}
35+
port: ${{ secrets.SERVER_PORT }}
36+
script: |
37+
cd /opengeoworks
38+
docker compose pull autoplan-python
39+
docker compose up --build -d autoplan-python

0 commit comments

Comments
 (0)