-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (43 loc) · 1.56 KB
/
release_prod.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
46
name: Release Prod Docker image to Linode
# on:
# release:
# types: [published]
on:
push:
branches-ignore:
- 'master'
jobs:
deploy_to_linode:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Copy docker-compose.yml to Linode
uses: appleboy/scp-action@master
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
source: './docker-compose.yml'
target: '/root/docker-compose-mongo/'
- name: Execute remote Docker Compose command
uses: appleboy/ssh-action@v1.0.3
env:
MONGO_INITDB_ROOT_USERNAME: 'admin'
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.MONGO_INITDB_ROOT_PASSWORD }}
DOCKER_EXPOSE_PORT: 27017
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
envs: MONGO_INITDB_ROOT_USERNAME,MONGO_INITDB_ROOT_PASSWORD,DOCKER_EXPOSE_PORT
script: |
cd /root/docker-compose-mongo/
docker compose -f docker-compose.yml pull
docker compose -f docker-compose.yml down
docker compose -f docker-compose.yml --project-name derecks_mongodb-prod down
docker container prune -f
docker system prune -af
docker compose -f docker-compose.yml up -d