iconoir/.github/workflows/website.yaml

78 lines
1.7 KiB
YAML
Raw Normal View History

name: Website
2022-08-28 21:02:54 +02:00
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: true
on:
workflow_dispatch: {}
jobs:
2022-08-28 21:02:54 +02:00
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 7
- name: Get pnpm store directory
id: pnpm-cache
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Build packages
run: pnpm run dist
- name: Build website
run: ./node_modules/.bin/next build
working-directory: iconoir.com
- name: Export website
run: ./node_modules/.bin/next export
working-directory: iconoir.com
- name: Setup GitHub Pages
uses: actions/configure-pages@v2
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: './iconoir.com/out'
2022-08-28 21:02:54 +02:00
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
2022-08-28 21:02:54 +02:00
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1