Skip to content

Commit 503c20c

Browse files
committed
provide config from repo
1 parent 9671e60 commit 503c20c

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

.github/workflows/ci-cd.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,13 @@ jobs:
106106
env:
107107
VPS_SSH_KEY: ${{ secrets.VPS_SSH_KEY }}
108108

109+
- name: Clone env-config
110+
run: |
111+
git clone https://${{ github.repository_owner }}:${{ secrets.GH_PAT }}@github.com/versolauth/env-config.git
112+
echo "ENV_CONFIG<<EOF" >> $GITHUB_ENV
113+
cat env-config/dev/env.conf >> $GITHUB_ENV
114+
echo "EOF" >> $GITHUB_ENV
115+
109116
- name: Copy docker-compose to VPS
110117
uses: appleboy/scp-action@v0.1.7
111118
with:
@@ -114,14 +121,13 @@ jobs:
114121
key: ${{ secrets.VPS_SSH_KEY }}
115122
source: "versola.yml"
116123
target: "~/versola"
117-
debug: true
118124

119125
- name: Deploy to VPS
120126
uses: appleboy/ssh-action@v1.2.0
121127
env:
122128
GH_PAT: ${{ secrets.GH_PAT }}
123129
GH_USER: ${{ github.repository_owner }}
124-
ENV_CONFIG: ${{ secrets.ENV_CONFIG }}
130+
ENV_CONFIG: ${{ env.ENV_CONFIG }}
125131
with:
126132
host: ${{ secrets.VPS_HOST }}
127133
username: ${{ secrets.VPS_USER }}
@@ -131,10 +137,9 @@ jobs:
131137
cd ~/versola
132138
133139
# Login to GitHub Container Registry
134-
echo $GH_PAT | docker login ghcr.io -u "$GH_USER" --password-stdin
140+
echo "$GH_PAT" | docker login ghcr.io -u "$GH_USER" --password-stdin
135141
136142
# Pull latest image and restart
137-
export ENV_CONFIG="$ENV_CONFIG"
138143
docker compose -f versola.yml pull
139144
docker compose -f versola.yml up -d
140145

versola.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ services:
33
image: ghcr.io/versolauth/versola:latest
44
container_name: versola-auth
55
restart: unless-stopped
6+
extra_hosts:
7+
- "host.docker.internal:host-gateway"
68
ports:
79
- "8080:8080"
810
- "9345:9345"

0 commit comments

Comments
 (0)