update prisma version #18
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: Build and deploy on Server | |
on: | |
push: | |
branches: | |
- main | |
env: | |
DIRECTORY: "${{ vars.DIRECTORY }}/${{ github.event.repository.name }}" | |
jobs: | |
build-and-deploy: | |
environment: Test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Set up SSH | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: Confirm host key | |
run: ssh-keyscan -H ${{ secrets.SERVER_HOST }} >> ~/.ssh/known_hosts | |
- name: Deploy on Server | |
run: | | |
ssh -t "${{ secrets.SERVER_USER }}"@"${{ secrets.SERVER_HOST }}" << EOF | |
if [ -d "$DIRECTORY" ]; then | |
rm -rf $DIRECTORY | |
fi | |
mkdir -p $DIRECTORY | |
cd $DIRECTORY | |
git clone https://github.com/${{ github.repository }} . | |
git submodule init | |
git submodule update | |
echo "${{ secrets.ENVS }}" > .env | |
sh deploy.sh | |
rm -rf $DIRECTORY | |
EOF |