debugging github actions #8
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: Jekyll site CI | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build the site in the iandennismiller/jekyll container | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
run: | | |
docker run \ | |
-v ${{ github.workspace }}:/srv/jekyll \ | |
-v ${{ github.workspace }}/_site:/srv/jekyll/_site \ | |
iandennismiller/jekyll:latest \ | |
/bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" && \ | |
echo 'OK' | |
get-gh-pages: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: iandennismiller/solarpunk@gh-pages | |
path: _gh-pages | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Deploy the site to the gh-pages branch | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }} | |
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }} | |
run: | | |
rsync -av --delete --checksum --exclude .git _site/ _gh-pages/ && \ | |
cd _gh-pages && \ | |
git add -A && \ | |
git commit -am "action publish" && \ | |
git push && \ | |
echo 'OK' | |
# git clone "https://${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" -b gh-pages _gh-pages && \ | |
# git config user.name "${GITHUB_ACTOR}" && \ | |
# git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && \ |