Add config.json to deploy and cleanup stale dirs
All checks were successful
Build and Push / build-all (push) Successful in 13s
All checks were successful
Build and Push / build-all (push) Successful in 13s
This commit is contained in:
parent
56a2146b71
commit
1220c5101d
1 changed files with 20 additions and 0 deletions
|
|
@ -42,6 +42,20 @@ jobs:
|
||||||
# Add host key (skip strict checking for first connection)
|
# Add host key (skip strict checking for first connection)
|
||||||
ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true
|
ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts 2>/dev/null || true
|
||||||
|
|
||||||
|
- name: Prepare server directory
|
||||||
|
run: |
|
||||||
|
ssh -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_PORT }} \
|
||||||
|
-o StrictHostKeyChecking=no \
|
||||||
|
root@${{ secrets.DEPLOY_HOST }} '
|
||||||
|
mkdir -p /opt/realms
|
||||||
|
# Remove any stale directories that should be files
|
||||||
|
[ -d /opt/realms/Server.xml ] && rm -rf /opt/realms/Server.xml
|
||||||
|
[ -d /opt/realms/init.sql ] && rm -rf /opt/realms/init.sql
|
||||||
|
[ -d /opt/realms/config.json ] && rm -rf /opt/realms/config.json
|
||||||
|
[ -d /opt/realms/docker-compose.yml ] && rm -rf /opt/realms/docker-compose.yml
|
||||||
|
true
|
||||||
|
'
|
||||||
|
|
||||||
- name: Copy config files to server
|
- name: Copy config files to server
|
||||||
run: |
|
run: |
|
||||||
# Copy docker-compose
|
# Copy docker-compose
|
||||||
|
|
@ -62,6 +76,12 @@ jobs:
|
||||||
database/init.sql \
|
database/init.sql \
|
||||||
root@${{ secrets.DEPLOY_HOST }}:/opt/realms/init.sql
|
root@${{ secrets.DEPLOY_HOST }}:/opt/realms/init.sql
|
||||||
|
|
||||||
|
# Copy backend config
|
||||||
|
scp -i ~/.ssh/deploy_key -P ${{ secrets.DEPLOY_PORT }} \
|
||||||
|
-o StrictHostKeyChecking=no \
|
||||||
|
backend/config.json.example \
|
||||||
|
root@${{ secrets.DEPLOY_HOST }}:/opt/realms/config.json
|
||||||
|
|
||||||
- name: Deploy to Production
|
- name: Deploy to Production
|
||||||
run: |
|
run: |
|
||||||
ssh -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_PORT }} \
|
ssh -i ~/.ssh/deploy_key -p ${{ secrets.DEPLOY_PORT }} \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue