Skip to content

Update next.js.yaml

Update next.js.yaml #5

Workflow file for this run

name: Next.js CI
on:
push:
branches:
- "main"
release:
types:
- created
jobs:
build:
name: πŸŽ‰ Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["20.x"]
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: πŸ”¨ Build Project
run: |
npm ci
npm run build --if-present
- name: List output files
run: find out/ -print
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: Build
path: out
release:
name: πŸš€ Release
needs: build
if: startsWith(github.event_name, 'release')
runs-on: ubuntu-latest
steps:
- name: 🚚 Get latest code
uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: πŸ”‘ Setup SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: πŸš€ Deploy Release
run: |
# Your deployment commands here
echo "Deploying release..."