Skip to content

Commit

Permalink
👷‍♂️ build(jekyll): add auto-commit action to Jekyll build workflow
Browse files Browse the repository at this point in the history
Added a step to the Jekyll build workflow to automatically commit and push changes to the 'master' branch. This ensures that the '_site' directory is updated with the latest build from the GitHub Action.
  • Loading branch information
chriskyfung committed Sep 30, 2024
1 parent 1acbe9f commit 2f86596
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions .github/workflows/jekyll-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ name: Deploy Jekyll site to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["remote-theme"]
branches: ["remote-theme", "build/*"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
contents: write
pages: write
id-token: write

Expand Down Expand Up @@ -56,6 +56,25 @@ jobs:
- name: Upload artifact
# Automatically uploads an artifact from the './_site' directory by default
uses: actions/upload-pages-artifact@v3
- name: List files
run: |
cd ./_site
pwd
ls
# - name: Commit and push changes
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: "jekyll build from Action ${GITHUB_SHA}"
# branch: master
# commit_options: '--no-verify --signoff'
# repository: '.'
# file_pattern: './site/*'
# status_options: '--untracked-files=no'
# add_options: '-A'
# push_options: '--force'
# skip_dirty_check: true
# skip_fetch: false
# skip_checkout: false

# Deployment job
deploy:
Expand All @@ -65,6 +84,20 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- uses: actions/download-artifact@v4
with:
name: github-pages
- name: Display structure of downloaded files
run: ls -R
# uses: stefanzweifel/git-auto-commit-action@v5
# with:
# commit_message: "jekyll build from Action ${GITHUB_SHA}"
# branch: master
# commit_options: '--no-verify --signoff'
# repository: './site/'
# status_options: '--untracked-files=no'
# add_options: '-A'
# push_options: '--force'
# skip_dirty_check: true
# skip_fetch: true
# skip_checkout: true

0 comments on commit 2f86596

Please sign in to comment.