From a2a566dfeac2c64b43072aa4aaf7c94f69c54e76 Mon Sep 17 00:00:00 2001 From: Zihan Wang <48570946+Beikewzh@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:39:55 -0500 Subject: [PATCH 1/2] Create jekyll.yml --- .github/workflows/jekyll.yml | 72 ++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 .github/workflows/jekyll.yml diff --git a/.github/workflows/jekyll.yml b/.github/workflows/jekyll.yml new file mode 100644 index 0000000..d0a3737 --- /dev/null +++ b/.github/workflows/jekyll.yml @@ -0,0 +1,72 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# Workflow to build and deploy a Jekyll site to GitHub Pages +name: Deploy Jekyll site to Pages + +on: + # Trigger workflow on pushes to the main branch + push: + branches: ["main"] + + # Allow manual workflow triggers + workflow_dispatch: + +# Permissions for GitHub Pages deployment +permissions: + contents: read + pages: write + id-token: write + +# Concurrency settings to prevent overlapping runs +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Job to build the Jekyll site + build: + runs-on: ubuntu-latest + + steps: + # Step 1: Checkout repository code + - name: Checkout + uses: actions/checkout@v4 + + # Step 2: Set up Ruby environment + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.1' # Adjust to match your local Ruby version + bundler-cache: true # Automatically runs 'bundle install' and caches gems + + # Step 3: Set up GitHub Pages + - name: Setup Pages + id: pages + uses: actions/configure-pages@v5 + + # Step 4: Build the Jekyll site + - name: Build with Jekyll + run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" + env: + JEKYLL_ENV: production + + # Step 5: Upload the built site as an artifact + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + + # Job to deploy the built site + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + + steps: + # Step 6: Deploy the site to GitHub Pages + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 From c6aff8de4aa9c4e9366180ffa5eff4f794d82364 Mon Sep 17 00:00:00 2001 From: Zihan Wang <48570946+Beikewzh@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:42:12 -0500 Subject: [PATCH 2/2] Delete .github/workflows/jekyll-docker.yml --- .github/workflows/jekyll-docker.yml | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 .github/workflows/jekyll-docker.yml diff --git a/.github/workflows/jekyll-docker.yml b/.github/workflows/jekyll-docker.yml deleted file mode 100644 index 3d0eedb..0000000 --- a/.github/workflows/jekyll-docker.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Jekyll site CI - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Build the site in the jekyll/builder container - run: | - docker run \ - -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ - jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future"