-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.14 KB
/
prod.yml
File metadata and controls
39 lines (34 loc) · 1.14 KB
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
name: Production DigitalOcean Deploy
on:
push:
branches:
- main
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push image
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
run: |
echo "Building and pushing docker image"
docker buildx build --platform=linux/amd64 -t $DOCKER_USERNAME/autoplan-python:latest .
docker push $DOCKER_USERNAME/autoplan-python:latest
- name: Deploy to DigitalOcean
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SERVER_SSH_KEY }}
port: ${{ secrets.SERVER_PORT }}
script: |
cd /opengeoworks/production
docker compose pull autoplan-python
docker compose up --build -d autoplan-python