mirror of https://gitlab.com/curben/blog
44 lines
1.0 KiB
YAML
44 lines
1.0 KiB
YAML
name: Pages
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Use Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version-file: ".nvmrc"
|
|
- name: Cache NPM dependencies
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-npm-cache
|
|
restore-keys: ${{ runner.os }}-npm-cache
|
|
- name: Install Dependencies
|
|
run: npm install --include=optional --force
|
|
- name: Build
|
|
run: npm run build
|
|
- name: Upload Pages artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./public
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
permissions:
|
|
pages: write
|
|
id-token: write
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|