diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml new file mode 100644 index 00000000..3d98008c --- /dev/null +++ b/.github/workflows/deploy-prod.yml @@ -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" diff --git a/deploy-prod.yml b/deploy-prod.yml new file mode 100644 index 00000000..38419faf --- /dev/null +++ b/deploy-prod.yml @@ -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 \ No newline at end of file diff --git a/index.html b/index.html index 7183720d..a1e93567 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - Conduit + gaojiingyuan