Publish to GitHub Pages #228
Workflow file for this run
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
name: Publish to GitHub Pages | |
on: | |
push: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
jekyll: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/cache@v2 | |
with: | |
path: vendor/bundle | |
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }} | |
restore-keys: | | |
${{ runner.os }}-gems- | |
- uses: helaili/jekyll-action@2.2.0 | |
with: | |
target_branch: gh-pages | |
keep_history: true | |
build_only: true | |
jekyll_build_options: -d /github/workspace/jekyll_build | |
- name: Deploy | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git fetch --all && git checkout gh-pages | |
git rm -rf v2 && mkdir v2 && cp -r jekyll_build/* v2 | |
touch v2/.nojekyll | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add v2 | |
git commit --allow-empty -m "jekyll build from Action ${GITHUB_SHA}" | |
git push https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git gh-pages:gh-pages |