Skip to content

remove extra envs

remove extra envs #17

Workflow file for this run

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