Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
d31003 committed Feb 1, 2025
1 parent 4730d1d commit 044fad9
Showing 1 changed file with 45 additions and 8 deletions.
53 changes: 45 additions & 8 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,58 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4.1' # Not needed with a .ruby-version file
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
cache-version: 1 # Increment this number if you need to re-download cached gems
ruby-version: '3.4.1'
bundler-cache: true
cache-version: 1

- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
with:
enablement: true

- name: Build with Jekyll
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: production
- name: Remove Symlinks (if any)
run: find _site -type l -delete

- name: Verify _site Directory
run: ls -la _site

- name: Check Artifact Size
run: du -sh _site || true
run: du -sh _site

- name: Remove Symlinks
run: find _site -type l -delete

- name: Remove Hard Links
run: find _site -type f -links +1 -exec cp --remove-destination {} {}.tmp \; -exec mv {}.tmp {} \;

- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
chmod -c -R +rX "_site" |
while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "_site" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: github-pages
path: _site
path: ${{ runner.temp }}/artifact.tar

deploy:
environment:
Expand All @@ -52,8 +80,17 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: github-pages
path: ${{ runner.temp }}

- name: Extract Artifact
run: tar -xvf $RUNNER_TEMP/artifact.tar -C _site

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact-name: github-pages
artifact-name: github-pages

0 comments on commit 044fad9

Please sign in to comment.