jekyll-build #145
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: Build and deploy | |
on: | |
push: | |
branches: main | |
repository_dispatch: | |
types: [jekyll-build] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build | |
uses: docker://jekyll/jekyll | |
with: | |
entrypoint: bash | |
args: -c "/usr/local/bin/bundle install && /usr/local/bin/bundle exec jekyll build --incremental" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Deploy | |
run: | | |
sudo chown -R $(whoami):$(whoami) . | |
git config --global user.email "[email protected]" | |
git config --global user.name "$GITHUB_ACTOR" | |
cp -r _site /tmp | |
cd /tmp/_site | |
git init | |
git branch -M gh-pages | |
git add . | |
git commit -m "Deploy Jekyll to GitHub Pages" | |
git remote add origin "https://$GITHUB_ACTOR:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY" | |
git push -f origin gh-pages |