Skip to content

Commit

Permalink
running frontend staging deployment action
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu committed Dec 9, 2024
1 parent 1c4b016 commit 48ea1c0
Showing 1 changed file with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
jobs:
build-and-deploy-frontend:
runs-on: ubuntu-latest
environment: Staging
defaults:
run:
shell: bash
Expand Down Expand Up @@ -37,15 +38,20 @@ jobs:
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: cd frontend && pnpm install --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: Build environment
run: |
cat << EOF > .env
VITE_API_URL=${{ secrets.BACKEND_URL }}/api/v1
EOF
- name: Build
run: cd frontend && pnpm build
run: pnpm build
- name: Deploy to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.PREVIEW_SERVER_IP }}
username: ${{ secrets.PREVIEW_USER }}
key: ${{ secrets.PREVIEW_SERVER_SSH_KEY }}
source: "frontend/dist/"
target: "${{ secrets.TARGET_DIR }}"
strip_components: 1
host: ${{ secrets.VPS_IP }}
username: ${{ secrets.VPS_USER }}
key: ${{ secrets.VPS_KEY }}
source: "frontend/dist/*"
target: "${{ secrets.FE_DIR }}"
strip_components: 2

0 comments on commit 48ea1c0

Please sign in to comment.