feat: don't load default listeners in prod env #8
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: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build project | |
run: pnpm run build | |
- name: Clean target directory on server | |
env: | |
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }} | |
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} | |
run: | | |
echo "${{ secrets.DEPLOY_KEY }}" > deploy_key | |
chmod 600 deploy_key | |
ssh -o StrictHostKeyChecking=no -i deploy_key ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_SERVER }} "rm -rf ${DEPLOY_PATH}/dist && mkdir -p ${DEPLOY_PATH}/dist" | |
rm deploy_key | |
- name: Deploy to server | |
env: | |
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }} | |
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} | |
run: | | |
echo "${{ secrets.DEPLOY_KEY }}" > deploy_key | |
chmod 600 deploy_key | |
scp -o StrictHostKeyChecking=no -i deploy_key -r dist/* ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_SERVER }}:${{ secrets.DEPLOY_PATH }}/dist | |
rm deploy_key | |
- name: Record deployment | |
env: | |
DEPLOY_SERVER: ${{ secrets.DEPLOY_SERVER }} | |
DEPLOY_USER: ${{ secrets.DEPLOY_USER }} | |
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }} | |
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} | |
run: | | |
echo "${{ secrets.DEPLOY_KEY }}" > deploy_key | |
chmod 600 deploy_key | |
ssh -o StrictHostKeyChecking=no -i deploy_key ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_SERVER }} "date > ${DEPLOY_PATH}/data/_deploy.log" | |
rm deploy_key |