adjust build #73
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
on: | |
push: | |
branches: | |
- stage | |
name: Update EC2 | |
jobs: | |
update: | |
name: Prod - SSH Login, Pull, Reload | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Node | |
uses: actions/[email protected] | |
with: | |
node-version: "19.x" | |
- run: npm install | |
- run: npx prisma generate | |
- run: npm run build | |
- name: copy file via ssh password | |
uses: appleboy/[email protected] | |
with: | |
host: ec2-52-34-213-210.us-west-2.compute.amazonaws.com | |
username: ubuntu | |
key: ${{ secrets.CARSONS_AWS_API_PRIVATE_KEY }} | |
source: ./.output | |
target: ~/carsons-village-stage | |
overwrite: true | |
tar_dereference: true | |
- name: Execute | |
uses: appleboy/[email protected] | |
with: | |
script: | | |
cd carsons-village-stage | |
git checkout stage | |
git pull | |
npm install | |
cp .env ./.output/server/.env | |
npx prisma migrate deploy | |
pm2 restart all | |
host: ec2-52-34-213-210.us-west-2.compute.amazonaws.com | |
username: ubuntu | |
key: ${{ secrets.CARSONS_AWS_API_PRIVATE_KEY }} |