Update build-and-upload.yml #139
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Upload | |
on: | |
push: | |
branches: [staging, main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: github.event.repository.fork == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
- name: Install pnpm | |
run: npm install -g pnpm | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build Next.js application | |
run: pnpm build | |
- name: Archive production artifacts | |
run: tar -czf boilerplate.tar.gz .next | |
- name: Copy Artifacts to server | |
run: | | |
sshpass -p "$PASSWORD" scp -o StrictHostKeyChecking=no boilerplate.tar.gz "$USERNAME@$HOST:~/build-artifacts" | |
- name: Delete zip file | |
run: rm -f boilerplate.tar.gz |