Merge pull request #19 from PoolC/feature #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |