Skip to content

Dynamic Books Page

Dynamic Books Page #16

name: CI/CD Pipeline
on:
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Use Node.JS
uses: actions/setup-node@v3
with:
node-version: '18.x'
- run: npm install
- run: npm run build
test:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout repository code
uses: actions/checkout@v3
- name: Use Node.JS
uses: actions/setup-node@v3
with:
node-verison: '18.x'
- run: npm install
- run: npm test
deploy:
needs: test
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: deployment
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout repository code
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.JS
uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Configure GitHub Pages
uses: actions/configure-pages@v3
with:
static_site_generator: next
- run: npm install
- run: npm run build
- run: ls -la
- name: Upload Artifacts
uses: actions/upload-pages-artifact@v1
with:
path: './out'
- name: Deploy to GitHub Pages
id: development
uses: actions/deploy-pages@v1