Skip to content

feat: shared pages

feat: shared pages #36

Workflow file for this run

name: Node.js CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
EC2_SSH_KEY: ${{ secrets.EC2_SSH_KEY }}
DO_SSH_KEY: ${{ secrets.DO_SSH_KEY }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
- run: yarn install
- run: yarn build
- name: Deploy to EC2
run: |
echo "${{ secrets.DO_SSH_KEY }}" > /tmp/ssh_key
chmod 600 /tmp/ssh_key
rsync -avz -e "ssh -i /tmp/ssh_key -o StrictHostKeyChecking=no" .output/ root@147.182.211.19:/root/studyhq/.output
ssh -i /tmp/ssh_key -o StrictHostKeyChecking=no root@147.182.211.19 'bash -c "source ~/.bashrc && source ~/.nvm/nvm.sh && pm2 restart all"'