Skip to content

Commit bee05bb

Browse files
authored
feat: deployment
1 parent c369773 commit bee05bb

File tree

2 files changed

+36
-4
lines changed

2 files changed

+36
-4
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ on:
88
jobs:
99
Deploy:
1010
runs-on: ubuntu-latest
11+
env:
12+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1113
steps:
12-
- name: Clone repository
13-
uses: actions/checkout@v2
14-
1514
- name: Deploy Salaourn Secret Service
1615
uses: appleboy/ssh-action@master
1716
with:
@@ -20,4 +19,13 @@ jobs:
2019
key: ${{ secrets.SSH_KEY }}
2120
port: ${{ secrets.SSH_PORT }}
2221
script: |
23-
pwd
22+
REPO_DIR="$(basename ${{ github.repository }})"
23+
if [ -d "$REPO_DIR" ]; then
24+
cd "$REPO_DIR"
25+
git pull origin master
26+
else
27+
git clone https://$GH_TOKEN@github.com/${{ github.repository }}.git
28+
cd "$REPO_DIR"
29+
fi
30+
docker-compose -f docker-compose-prod.yml build --no-cache
31+
docker-compose -f docker-compose-prod.yml up -d --force-recreate

docker-compose-prod.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: "3.0"
2+
3+
services:
4+
memcached:
5+
image: memcached
6+
restart: always
7+
expose:
8+
- "11211"
9+
network_mode: bridge
10+
11+
yopass:
12+
image: yopass:latest
13+
build:
14+
context: .
15+
dockerfile: Dockerfile
16+
restart: always
17+
ports:
18+
- "127.0.0.1:8080:8080"
19+
command: "--memcached=memcached:11211 --port 8080"
20+
environment:
21+
- VIRTUAL_HOST=secret.salaourn.com
22+
- LETSENCRYPT_HOST=secret.salaourn.com
23+
- LETSENCRYPT_EMAIL=dprisc97@gmail.com
24+
network_mode: bridge

0 commit comments

Comments
 (0)