Skip to content

Commit

Permalink
feat: Add GitHub Actions workflow for building and deploying HTML fil…
Browse files Browse the repository at this point in the history
…es to GitHub Pages, update .gitignore to include HTML files
  • Loading branch information
rohanod committed Nov 12, 2024
1 parent 951e0d0 commit c03cf67
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build and Deploy to GitHub Pages

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install Dependencies
run: npm install

- name: Cleanup Existing HTML Files
run: |
rm -f index.html
rm -f page*.html
- name: Generate HTML Files
run: node generate-pages-github.js

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./ # The directory where HTML files are generated
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,8 @@ dist-ssr
*.njsproj
*.sln
*.sw?


# HTML files
index.html
page*.html

0 comments on commit c03cf67

Please sign in to comment.