mirror of
https://github.com/absmach/supermq.git
synced 2026-06-23 07:00:25 +00:00
25d883bbe2
Signed-off-by: ianmuchyri <ianmuchiri8@gmail.com>
77 lines
1.7 KiB
YAML
77 lines
1.7 KiB
YAML
name: Deploy Landing page and docs
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
name: Install pnpm
|
|
with:
|
|
version: 10
|
|
run_install: false
|
|
|
|
- name: Install Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
cache: "pnpm"
|
|
cache-dependency-path: "web/pnpm-lock.yaml"
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install
|
|
working-directory: ./web
|
|
|
|
- name: Setup Pages
|
|
id: setup_pages
|
|
uses: actions/configure-pages@v5
|
|
|
|
- name: Restore cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
web/.next/cache
|
|
key: ${{ runner.os }}-nextjs-${{ hashFiles('web/pnpm-lock.yaml') }}-${{ hashFiles('web/**.[jt]s', 'web/**.[jt]sx') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-nextjs-${{ hashFiles('web/pnpm-lock.yaml') }}-
|
|
|
|
- name: Build with Next.js
|
|
run: pnpm run build
|
|
working-directory: ./web
|
|
env:
|
|
FQ_BASE_PATH: ${{ steps.setup_pages.outputs.base_path }}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./web/out
|
|
|
|
deploy:
|
|
name: Deploy to github pages
|
|
|
|
environment:
|
|
name: github-pages
|
|
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|
|
env:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|