Skip to content

Commit

Permalink
Merge pull request #53 from apify/feature/gh-50-github-pages-integration
Browse files Browse the repository at this point in the history
GitHub Pages integration
  • Loading branch information
vancura authored Jan 22, 2025
2 parents 4933d95 + 0cf435b commit 96fb6d9
Show file tree
Hide file tree
Showing 8 changed files with 343 additions and 119 deletions.
2 changes: 1 addition & 1 deletion .cursorrules
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ You are an expert in TypeScript, Astro framework, Tailwind CSS, and modern web d
- Use environment variables for configuration.
- Access variables securely in Astro using `import.meta.env`.
- **Static Hosting**:
- Deploy to platforms like Netlify, Vercel, or Cloudflare Pages.
- Deploy to platforms like Netlify, Vercel, GitHub Pages, or Cloudflare Pages.
- Ensure your build command is correctly set (usually `astro build`).
- **Continuous Integration/Continuous Deployment (CI/CD)**:
- Set up automated builds and tests in your CI/CD pipeline.
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy to GitHub Pages

on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: [ main, 'feature/gh-50-github-pages-integration' ]
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v4

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

- name: Clean install
run: |
rm -rf node_modules
rm -f package-lock.json
npm install
- name: Build
run: npm run build

- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist/

deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,16 @@ This repository contains the documentation website for the Actor Programming Mod

- Built with Astro for optimal static site generation
- Responsive design with Tailwind CSS
- Interactive Table of Contents with progress tracking
- Interactive Table of Contents with progress tracking and filtering
- Code syntax highlighting with copy functionality
- Dark mode support
- MDX content support with custom components
- Modal-based navigation system for internal links
- Enhanced modal-based navigation system with nested states
- Smooth scroll behavior for navigation
- Banner component for improved inner page context
- Automatic sitemap generation for improved SEO
- GitHub integration with real-time star count
- Analytics integration with Plausible

## Tech Stack

Expand All @@ -24,7 +26,7 @@ This repository contains the documentation website for the Actor Programming Mod
- [Sharp](https://sharp.pixelplumbing.com/) - Image optimization
- [ESLint](https://eslint.org/) - Code linting
- [Prettier](https://prettier.io/) - Code formatting
- [Vercel](https://vercel.com) - Deployment
- [GitHub Pages](https://pages.github.com) - Deployment

## Prerequisites

Expand Down Expand Up @@ -63,7 +65,7 @@ npm run dev

## Project Structure

```
```text
src/
├── components/ # Reusable UI components
├── config/ # Configuration files
Expand Down Expand Up @@ -103,10 +105,14 @@ SEO configuration can be found in the BaseHead component: [src/components/BaseHe
The site implements various performance optimizations:

- Image optimization with Sharp
- Asset caching through Vercel
- Asset caching through GitHub Pages
- CSS and JavaScript minification
- Responsive images with multiple formats

## Analytics

The site uses Plausible Analytics for privacy-friendly website analytics in production environments. Analytics configuration can be found in the BaseHead component.

## Contributing

1. Fork the repository
Expand Down
3 changes: 2 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import remarkGfm from 'remark-gfm';
import remarkSmartypants from 'remark-smartypants';

export default defineConfig({
site: 'https://whitepaper.actor',
site: 'https://apify.github.io',
base: 'actor-whitepaper-web',
prefetch: true,
devToolbar: { enabled: false },

Expand Down
Loading

0 comments on commit 96fb6d9

Please sign in to comment.