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..c2689f73 100644 --- a/.github/workflows/eleventy_build.yml +++ b/.github/workflows/eleventy_build.yml @@ -4,21 +4,29 @@ on: push: branches: - main + pull_request: + branches: + - main + jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.6.0 - - name: Setup Node - uses: actions/setup-node@v3.8.1 + - name: Checkout repository + uses: actions/checkout@v4 + - name: Setup Node.js + uses: actions/setup-node@v4 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: @@ -26,3 +34,19 @@ jobs: 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/.stylelintignore b/.stylelintignore index 5193525c..8fd68a61 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -1,3 +1,6 @@ src/sass/fa/** src/sass/fontawesome.scss node_modules/bootstrap/scss/*.scss +src/sass/prism.scss +src/sass/print.scss +src/sass/** diff --git a/.stylelintrc.json b/.stylelintrc.json index 2d8ab021..1d2260e2 100644 --- a/.stylelintrc.json +++ b/.stylelintrc.json @@ -16,5 +16,6 @@ "rule-empty-line-before": null, "at-rule-empty-line-before": null, "scss/at-extend-no-missing-placeholder": null - } + }, + "allowEmptyInput": true } diff --git a/docs/about/index.html b/docs/about/index.html index 8d91f5c6..13c0edd5 100644 --- a/docs/about/index.html +++ b/docs/about/index.html @@ -325,7 +325,13 @@