Update next.js.yaml #7
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@v4 # Обновлено на версию 4 | |
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@v4 # Обновлено на версию 4 | |
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@v4 # Обновлено на версию 4 | |
with: | |
node-version: 20.x | |
- name: 🔑 Setup SSH | |
uses: webfactory/ssh-agent@v1 # Обновлено на версию 1 | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
- name: 🚀 Deploy Release | |
run: | | |
# Ваши команды развертывания здесь | |
echo "Deploying release..." |