Created
September 23, 2019 12:47
-
-
Save faph/70f495d54681fee6353e8eaa8b005b37 to your computer and use it in GitHub Desktop.
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
jobs: | |
build: | |
steps: | |
- name: Configure git | |
run: | | |
git config --global committer.email "[email protected]" | |
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