bundle install #62
This file contains 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
# This workflow builds and deploys a Jekyll site to GitHub Pages | |
name: Deploy Jekyll site to Pages | |
on: | |
# Triggers the workflow on pushes to the main branch | |
push: | |
branches: ["main"] | |
# Allows manually triggering the workflow from the Actions tab | |
workflow_dispatch: | |
# Sets permissions required for GitHub Pages deployment | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
# Ensures only one deployment runs at a time | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
jobs: | |
# Job to build the Jekyll site | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v4 | |
- name: Setup Ruby environment | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.2.2' # Define the Ruby version | |
bundler-cache: true # Enables bundler caching | |
- name: Setup GitHub Pages | |
id: pages | |
uses: actions/configure-pages@v5 | |
- name: Build with Jekyll | |
# By default, outputs to './_site' directory | |
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | |
env: | |
JEKYLL_ENV: production # Set environment to production | |
# Add CNAME file to the build output directory | |
- name: Add CNAME file | |
run: echo "docs.lzzs.fun" > ./_site/CNAME | |
- name: Upload artifact to GitHub Pages | |
uses: actions/upload-pages-artifact@v3 | |
# Job to deploy the site to GitHub Pages | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} # Publishes the deployment URL | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |