Skip to content

Merge pull request #110 from glencoden/staging #15

Merge pull request #110 from glencoden/staging

Merge pull request #110 from glencoden/staging #15

Workflow file for this run

on:
push:
branches:
- main
jobs:
deploy-prod:
runs-on: ubuntu-latest
steps:
- name: copy ssh key
run: |
mkdir -p ~/.ssh
echo -e "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- name: pull wolke repository and run docker
run: |
ssh root@${{ secrets.SERVER_ADDRESS_PROD }} <<"ENDSSH"
mkdir -p /root/apps/wolke
cd /root/apps/wolke
git pull || git clone -b main --single-branch git@github.com:glencoden/wolke.git ./
echo "${{ secrets.ENV_LIVE }}" > .env
echo "${{ secrets.ENV_PROD }}" > .env.prod
cat .env.prod >> .env
docker compose down --rmi local
docker compose up -d --build
docker system prune -f
ENDSSH
- name: init and remove database as listed in .env
run: |
ssh root@${{ secrets.SERVER_ADDRESS_PROD }} <<"ENDSSH"
cd /root/apps/wolke
bash scripts/init-database.sh
ENDSSH