Merge pull request #13 from vintasoftware/fix/id-code-items #14
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 deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
# Setup Node v20 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 20 | |
- name: Setup Pages | |
uses: actions/configure-pages@v3 | |
with: | |
# Automatically inject basePath in your Next.js configuration file and disable | |
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized). | |
static_site_generator: next | |
- name: Restore cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- name: Install npm dependencies | |
run: npm ci | |
# Build the project | |
- name: Build the app | |
run: npm run build | |
# Upload artifacts to Github Pages | |
- name: Upload GitHub Pages artifacts | |
uses: actions/upload-pages-artifact@v1.0.8 | |
with: | |
path: "out/" | |
deploy: | |
needs: build | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | |
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v2 |