Skip to content

feat: add question/answer loop #99

feat: add question/answer loop

feat: add question/answer loop #99

Workflow file for this run

name: Build and deploy app
on:
push:
pull_request:
# permissions:
# contents: write
jobs:
build:
name: Build and deploy app
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Setup Yarn
uses: threeal/setup-yarn-action@v2.0.0
with:
cache: false
- name: Build app
run: yarn run build
# If the app builds successfully, and is not a PR:
# Deploy to production
- name: Deploy with ssh
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
uses: appleboy/ssh-action@v1.1.0
with:
host: ${{ secrets.SSH_DEPLOY_IP }}
username: ${{ secrets.SSH_DEPLOY_USER }}
key: ${{ secrets.SSH_DEPLOY_KEY }}
script: |
source ~/.zshrc &&
cd ~/backend-server &&
git pull &&
git submodule update --init --recursive &&
git pull --recurse-submodules &&
yarn install &&
yarn run build &&
yarn run up