Skip to content

Commit

Permalink
ci: deploy to github pages
Browse files Browse the repository at this point in the history
  • Loading branch information
vermaysha committed Apr 19, 2024
1 parent 11355d2 commit e8fe04d
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Deploy to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: latest
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.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 website
run: pnpm build

- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: build

deploy:
name: Deploy to GitHub Pages
needs: build

# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
4 changes: 2 additions & 2 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ const config: Config = {
favicon: 'img/GMDP_full.webp',

// Set the production url of your site here
url: 'https://your-docusaurus-site.example.com',
url: 'https://GMDP-Developers.github.io',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',
baseUrl: '/ebilling-docs/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down

0 comments on commit e8fe04d

Please sign in to comment.