Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: deploy on push production branch
on:
push:
branches:
- prod
jobs:
deploy-app:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: build
run: |
pnpm install --no-frozen-lockfile
pnpm build
- name: deploy
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ubuntu
key: ${{ secrets.SSH_KEY }}
source: "./dist/*"
target: "/var/www/html"
37 changes: 37 additions & 0 deletions deploy-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: deploy on push production branch
on:
push:
branches:
- prod
jobs:
deploy-app:
runs-on: ubuntu-latest
steps:
- name: check out the code to build server
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
version: 10
run_install: false

- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: build the code
run: |
pnpm install --no-frozen-lockfile
pnpm build

- name: copy file to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.SSH_USER_NAME }}
key: ${{ secrets.SSH_KEY }}
source: "./dist/*"
target: "/var/www/html"
strip_components: 1
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Conduit</title>
<title>gaojiingyuan</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link rel="icon" href="/favicon.ico" />
Expand Down