Skip to content
name: Build and Deploy Preview / Frontend
on:
push:
branches:
- main
paths:
- 'frontend/**'
jobs:
build-and-deploy-frontend:
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: frontend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Debug frontend directory
run: ls -la
- name: Get pnpm store directory
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Debug pnpm store path
run: echo "pnpm store path is: $STORE_PATH"

Check failure on line 40 in .github/workflows/deploy-preview-frontend.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-preview-frontend.yml

Invalid workflow file

You have an error in your yaml syntax on line 40
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('frontend/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: 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: "dist/"
target: "${{ secrets.TARGET_DIR }}"
strip_components: 1