Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into gh-page
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Nov 11, 2024
2 parents ea1bf58 + 56fac5f commit a90f02f
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Deploy Next.js site to Pages

on:
push:
branches: [ "gh-page" ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./src/frontend

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: Create .npmrc for authentication
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
echo "@ts4nfdi:registry=https://npm.pkg.github.com" >> ~/.npmrc
- name: Setup Pages
uses: actions/configure-pages@v4

- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- name: Install dependencies
run: npm install --legacy-peer-deps

- name: Build with Next.js
run: npm run build

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./out

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit a90f02f

Please sign in to comment.