Skip to content

Commit

Permalink
♻️ add deployment workflow for docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ashiishme committed Aug 31, 2023
1 parent 0c613a5 commit 1548d16
Showing 1 changed file with 73 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Deploy Bikram Sambat Docs

on:
push:
branches: ['main']
paths: ['docs/**']

workflow_dispatch:

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

concurrency:
group: 'pages'
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'yarn'

- name: Setup Pages
uses: actions/configure-pages@v2
with:
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('**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-
- name: Install dependencies
run: yarn install

- name: Build Docs App
run: yarn next build

- name: Export Docs App
run: yarn next export

- name: Upload Docs App
uses: actions/upload-pages-artifact@v1
with:
path: ./out

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

0 comments on commit 1548d16

Please sign in to comment.