Skip to content

Commit

Permalink
docs: -update workflow file
Browse files Browse the repository at this point in the history
  • Loading branch information
amirrezaDev1378 committed Nov 14, 2024
1 parent 763e8f3 commit c2640e1
Showing 1 changed file with 32 additions and 27 deletions.
59 changes: 32 additions & 27 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,60 @@
name: Deploy Docusaurus to GitHub Pages
name: Deploy to GitHub Pages

on:
push:
branches: [ main , docs/* ]
pull_request:
branches: [ main , docs/* ]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write
branches:
- main
- docs/*

jobs:
build:
name: Build Docusaurus
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./documents
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Setup Pages
uses: actions/configure-pages@v4
- name: Get bun store path
id: bun-store-path
run: echo "STORE_PATH=$(bun pm cache dir)" >> $GITHUB_OUTPUT

- name: Cache bun dependencies
uses: actions/cache@v3
with:
path: ${{ steps.bun-store-path.outputs.STORE_PATH }}
key: ${{ runner.os }}-bun-store-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-store-
- name: Install dependencies
run: bun install
run: bun install --frozen-lockfile

- name: Build website
run: |
bun run build
ls -la # Debug: List all files
ls -la build || ls -la ./dist # Debug: Check both possible build directories
run: bun run build

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

deploy:
name: Deploy to GitHub Pages
needs: build
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build

runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Deploy to GitHub Pages
id: deployment
Expand Down

0 comments on commit c2640e1

Please sign in to comment.