deps(deps): bump the production-dependencies group across 1 directory with 9 updates #52
Workflow file for this run
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: CI/CD Pipeline | |
| on: | |
| push: | |
| branches: [ master, publish ] | |
| pull_request: | |
| branches: [ master, publish ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| # Build job | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3.5' | |
| bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v5 | |
| with: | |
| node-version-file: '.nvmrc' | |
| cache: 'npm' | |
| - name: Install Node.js dependencies | |
| run: npm ci | |
| - name: Lint JavaScript | |
| run: npm run lint | |
| - name: Build site | |
| run: npm run build | |
| env: | |
| JEKYLL_ENV: production | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: site-build | |
| path: _site/ | |
| retention-days: 1 | |
| # Deployment job - push built files to master branch | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/publish' && github.event_name == 'push' | |
| steps: | |
| - name: Checkout master branch | |
| uses: actions/checkout@v5 | |
| with: | |
| ref: master | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| fetch-depth: 0 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: site-build | |
| path: _site/ | |
| - name: Deploy to master branch | |
| run: | | |
| # Configure git | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| # Remove all files except .git and _site | |
| find . -maxdepth 1 ! -name '.git' ! -name '_site' ! -name '.' ! -name '..' -exec rm -rf {} + | |
| # Copy built site files to root (GitHub Pages expects files in root, not in _site) | |
| cp -r _site/* . | |
| # Remove the _site directory (not needed for GitHub Pages) | |
| rm -rf _site | |
| # Add and commit changes | |
| git add -A | |
| if git diff --staged --quiet; then | |
| echo "No changes to deploy" | |
| else | |
| git commit -m "CI deploy to gh-pages from publish@${{ github.sha }}" | |
| git push origin master | |
| fi |