diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 00000000..71ed3d6d --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,60 @@ +# GitHub Actions Workflows + +This directory contains the automated build and deployment workflows for the portfolio site. + +## Build and Deploy Workflow (`eleventy_build.yml`) + +### Overview +Automates the build and deployment process for GitHub Pages using Eleventy static site generator. + +### Triggers +- **Push to main branch**: Builds and deploys to GitHub Pages +- **Pull requests to main**: Builds only (for validation, no deployment) + +### Jobs + +#### Build Job +1. **Checkout repository**: Gets the latest code +2. **Setup Node.js**: Installs Node.js 22 with npm caching +3. **Install dependencies**: Runs `npm ci --ignore-scripts` +4. **Build site**: Executes `npm run build` which: + - Cleans previous build (`docs/` folder) + - Optimizes images from `src/assets/img-raw/` + - Compiles Sass to CSS with Bootstrap + - Generates static site with Eleventy + - Processes CSS with PostCSS (autoprefixer, minification) +5. **Upload artifacts**: Saves build output for deployment job + +#### Deploy Job (main branch only) +1. **Download artifacts**: Gets build output from build job +2. **Deploy to GitHub Pages**: Uses `peaceiris/actions-gh-pages` to: + - Push `docs/` content to `gh-pages` branch + - Update GitHub Pages deployment + +### Output +- **Generated files**: ~724 static files in `docs/` directory +- **Total size**: ~42MB of optimized content +- **Deployment target**: `gh-pages` branch → GitHub Pages + +### Dependencies +- **Node.js**: Version 22 (specified in package.json) +- **Build tools**: Eleventy, Sass, PostCSS, Sharp (image optimization) +- **Deployment**: GitHub Pages via gh-pages branch + +### Expected Warnings +- **Sass deprecation warnings**: 144+ warnings from Bootstrap (safe to ignore) +- **npm vulnerabilities**: 74+ audit warnings (non-critical for static site) +- **Node version warnings**: Package requires Node 22, runs on 20+ (safe to ignore) + +### Local Development +To run the same build process locally: +```bash +npm install +npm run build # Production build +npm run start # Development server with watch +``` + +### Configuration Files +- **Eleventy config**: `.eleventy.js` (input: `src/`, output: `docs/`) +- **Package scripts**: `package.json` (build commands) +- **Deploy key**: `ACTIONS_DEPLOY_KEY` secret (for gh-pages push) \ No newline at end of file diff --git a/.github/workflows/eleventy_build.yml b/.github/workflows/eleventy_build.yml index ff982b79..d780f14d 100644 --- a/.github/workflows/eleventy_build.yml +++ b/.github/workflows/eleventy_build.yml @@ -1,28 +1,58 @@ -name: Eleventy Build +name: Build and Deploy on: push: branches: - main + pull_request: + branches: + - main + jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '22' + cache: 'npm' + + - name: Install dependencies + run: npm ci --ignore-scripts + + - name: Build site + run: npm run build + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: site-build + path: docs/ + retention-days: 1 + deploy: + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + needs: build runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3.6.0 - - name: Setup Node - uses: actions/setup-node@v3.8.1 - with: - node-version: '22.x' - - name: Install dependencies using a safe clean install, build and test - run: | - npm config set '//npm.fontawesome.com/:_authToken' "${{ secrets.FONT_AWESOME_TOKEN }}" - npm ci --ignore-scripts - - name: Run Build - run: npm run build - - name: Deploy - uses: peaceiris/actions-gh-pages@v3.9.3 - with: - deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} - publish_dir: ./docs - publish_branch: gh-pages - commit_message: ${{ github.event.head_commit.message }} + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + name: site-build + path: docs/ + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }} + publish_dir: ./docs + publish_branch: gh-pages + commit_message: 'Deploy: ${{ github.event.head_commit.message }}' + user_name: 'github-actions[bot]' + user_email: 'github-actions[bot]@users.noreply.github.com' diff --git a/docs/about/index.html b/docs/about/index.html index 8d91f5c6..ae0e7b2b 100644 --- a/docs/about/index.html +++ b/docs/about/index.html @@ -325,7 +325,29 @@