ci(github): add github action to redeploy latest version after docker image ci
This commit is contained in:
parent
43ce43ab5b
commit
2e288a5407
|
@ -0,0 +1,21 @@
|
||||||
|
name: Deploy Latest Version on DigitalOcean
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows:
|
||||||
|
- Build and Push Docker Image
|
||||||
|
types:
|
||||||
|
- completed
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Install DigitalOcean CLI
|
||||||
|
uses: digitalocean/action-doctl@v2.1.0
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.DIGITALOCEAN_TOKEN }}
|
||||||
|
|
||||||
|
- name: Create Deployment with Latest Version
|
||||||
|
run: doctl apps create-deployment ${{ secrets.DIGITALOCEAN_APP_ID }} --wait --force-rebuild
|
|
@ -3,7 +3,7 @@ name: Build and Push Docker Image
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'v3'
|
- v3
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker_client:
|
docker_client:
|
||||||
|
|
|
@ -1,10 +1,22 @@
|
||||||
version: '3'
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
container_name: postgres
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
env_file: .env
|
||||||
|
volumes:
|
||||||
|
- ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql
|
||||||
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
|
||||||
server:
|
server:
|
||||||
image: amruthpillai/reactive-resume:server-latest
|
image: amruthpillai/reactive-resume:server-latest
|
||||||
container_name: server
|
container_name: server
|
||||||
env_file: .env
|
env_file: .env
|
||||||
|
environment:
|
||||||
|
- POSTGRES_HOST=postgres
|
||||||
ports:
|
ports:
|
||||||
- 3100:3100
|
- 3100:3100
|
||||||
|
|
||||||
|
@ -16,3 +28,6 @@ services:
|
||||||
- 3000:3000
|
- 3000:3000
|
||||||
depends_on:
|
depends_on:
|
||||||
- server
|
- server
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
pgdata:
|
||||||
|
|
|
@ -11,29 +11,29 @@ services:
|
||||||
- ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql
|
- ./scripts/database/initialize.sql:/docker-entrypoint-initdb.d/initialize.sql
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
|
||||||
# server:
|
server:
|
||||||
# build:
|
build:
|
||||||
# context: .
|
context: .
|
||||||
# dockerfile: server/Dockerfile
|
dockerfile: server/Dockerfile
|
||||||
# container_name: server
|
container_name: server
|
||||||
# env_file: .env
|
env_file: .env
|
||||||
# environment:
|
environment:
|
||||||
# - POSTGRES_HOST=postgres
|
- POSTGRES_HOST=postgres
|
||||||
# ports:
|
ports:
|
||||||
# - 3100:3100
|
- 3100:3100
|
||||||
# depends_on:
|
depends_on:
|
||||||
# - postgres
|
- postgres
|
||||||
|
|
||||||
# client:
|
client:
|
||||||
# build:
|
build:
|
||||||
# context: .
|
context: .
|
||||||
# dockerfile: client/Dockerfile
|
dockerfile: client/Dockerfile
|
||||||
# container_name: client
|
container_name: client
|
||||||
# env_file: .env
|
env_file: .env
|
||||||
# ports:
|
ports:
|
||||||
# - 3000:3000
|
- 3000:3000
|
||||||
# depends_on:
|
depends_on:
|
||||||
# - server
|
- server
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pgdata:
|
pgdata:
|
||||||
|
|
Loading…
Reference in New Issue