Next.js CI #6
Workflow file for this run
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: 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/ssh-agent@v0.5.3 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: π Deploy Release | |
run: | | |
# Your deployment commands here | |
echo "Deploying release..." |