Pages deplay modified #2
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: Deploy Jekyll site to Pages | |
| on: | |
| push: | |
| branches: [ "main" ] # Triggers on pushes to main branch | |
| workflow_dispatch: # Allows manual trigger from Actions tab | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false # Prevents multiple runs from queuing | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 # Gets your repo code | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: '3.3' # Or whatever your Gemfile needs (Chirpy often uses 3.1+) | |
| bundler-cache: true # Caches gems for faster runs | |
| - name: Install dependencies | |
| run: bundle install # Installs jekyll-theme-chirpy + other gems | |
| # Chirpy-specific steps (these run bash scripts to generate extra files like tags/categories) | |
| - name: Build Chirpy extras | |
| run: | | |
| bash tools/run.sh # Or similar; generates _site-ready files | |
| - name: Build with Jekyll | |
| run: bundle exec jekyll build --verbose # Builds the static site | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 # Prepares built site for deployment | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 # Deploys the artifact to your Pages site |