Skip to content

Merge pull request #19 from PoolC/feature #6

Merge pull request #19 from PoolC/feature

Merge pull request #19 from PoolC/feature #6

name: deploy
on:
push:
branches: [master]
jobs:
deploy:
runs-on: ubuntu-22.04
environment: production
steps:
- uses: actions/checkout@v3
- name: clone and execute
uses: appleboy/[email protected]
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USERNAME }}
password: ${{ secrets.SSH_PASSWORD }}
key: ${{ secrets.SSH_PEM_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
DIRECTORY=dialga
if [ -d "$DIRECTORY" ]
then
cd "$DIRECTORY/Dialga"
git pull
else
mkdir $DIRECTORY
cd $DIRECTORY
git clone https://github.com/PoolC/Dialga.git
cd Dialga
fi
ENV_PRODUCTION=.env.production
echo "VITE_API_BASE_URL=$secrets.VITE_API_BASE_URL" > $ENV_PRODUCTION
echo "VITE_FILE_URL=$secrets.VITE_FILE_URL" > $ENV_PRODUCTION
echo "VITE_MAX_FILE_SIZE=$secrets.VITE_MAX_FILE_SIZE" > $ENV_PRODUCTION
docker compose down
docker compose up -d --build