Merge pull request #156 from anveshmuppeda/feature/docs_update #30
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | name: Deploy to GitHub Pages | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - 'src/**' | |
| - 'static/**' | |
| - 'blog/**' | |
| - 'commands/**' | |
| - 'k8swebsite.config.ts' | |
| - 'package.json' | |
| - 'sidebars.ts' | |
| - '.github/workflows/deploy.yml' | |
| jobs: | |
| build: | |
| name: Build Kubernetes Website | |
| runs-on: ubuntu-latest | |
| if: ${{ github.repository_owner == 'anveshmuppeda' }} # Only run in anveshmuppeda/kubernetes repository | |
| steps: | |
| # Step 1: Checkout the repository | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Step 2: Set up Node.js | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 | |
| cache: npm | |
| # Step 3: Install dependencies | |
| - name: Install dependencies | |
| run: npm ci --legacy-peer-deps | |
| # Step 4: Build the website | |
| - name: Build website | |
| run: npm run build | |
| # Step 5: Upload the build artifact | |
| - 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: | |
| # Step 6: Deploy to GitHub Pages | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |