Skip to content

Instantly share code, notes, and snippets.

@faph
Created September 23, 2019 12:47
Show Gist options
  • Save faph/70f495d54681fee6353e8eaa8b005b37 to your computer and use it in GitHub Desktop.
Save faph/70f495d54681fee6353e8eaa8b005b37 to your computer and use it in GitHub Desktop.
jobs:
build:
steps:
- name: Configure git
run: |
git config --global committer.email "noreply@github.com"
git config --global committer.name "GitHub"
git config --global author.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global author.name "${GITHUB_ACTOR}"
- name: Commit and push build dir
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
credentials=$(echo -n "${GITHUB_ACTOR}:${GITHUB_TOKEN}" | base64)
authheader="Authorization: Basic ${credentials}"
remote="https://github.com/${GITHUB_REPOSITORY}.git"
branch="gh-pages"
pushd _site
git init
git add .
git commit --message "Publishing website" --verbose
git -c http.extraheader="${authheader}" --force push $remote master:$branch
popd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment