Skip to content

Merge pull request #15 from yzyshimisi/main #16

Merge pull request #15 from yzyshimisi/main

Merge pull request #15 from yzyshimisi/main #16

Workflow file for this run

name: Deploy
on:
workflow_dispatch: {}
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: pnpm/action-setup@v4
name: Install pnpm
id: pnpm-install
with:
version: 9
run_install: false
- name: Install npm dependencies
run: pnpm install --frozen-lockfile
- name: Set up back-end url
env:
BACKEND_URL: ${{ secrets.BACKEND_URL }}
run: |
sed -i "s|REPLACE_ME|$BACKEND_URL|g" src/utils/const.ts
- name: Build
run: pnpm run build
- name: Setup Deploy Private Key
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh/
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan blog.zhullyb.top >> ~/.ssh/known_hosts
- name: Install rsync
run: |
sudo apt-get install rsync
- name: Deploy
id: deployment
run: |
rsync -avz --delete dist/ root@blog.zhullyb.top:/var/www/jh/