diff --git a/.github/workflows/ghpages.yml b/.github/workflows/ghpages.yml new file mode 100644 index 0000000..6cdcc0d --- /dev/null +++ b/.github/workflows/ghpages.yml @@ -0,0 +1,15 @@ +name: Github Pages + +on: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - run: ./build_gh-pages.sh + env: + GITHUB_ACCESS_TOKEN: ${{ secrets.github_token }} diff --git a/build_gh-pages.sh b/build_gh-pages.sh index 62c0506..02e0231 100755 --- a/build_gh-pages.sh +++ b/build_gh-pages.sh @@ -1,13 +1,6 @@ #!/bin/bash -# Only generate gh-pages from master branch - -GIT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" -if [ "$TRAVIS_BRANCH" != "master" ] && [ "$GIT_BRANCH" != "master" ] -then - echo "Not on master branch. Not attempting to generate gh-pages. TRAVIS_BRANCH is: $TRAVIS_BRANCH GIT_BRANCH is: $GIT_BRANCH" - exit 0 -fi +sudo gem install asciidoctor --version 1.5.8 # Don't create gh-pages from dirty working directory if [ "`git status -s`" ] @@ -54,12 +47,12 @@ popd # Commit the new content pushd "$GH_PAGES" git add --all -git config user.name "travis@travis-ci.org"; -git config user.email "Travis CI"; +git config user.name "github-actions@github.org"; +git config user.email "Github Actions"; git commit -m "[build_gh-pages.sh] Update gh-pages from ""$GIT_COMMIT_HASH" # Push content -git push https://${GITHUB_ACCESS_TOKEN}@github.com/hupfdule/kilt.git +git push https://x-access-token:${GITHUB_ACCESS_TOKEN}@github.com/hupfdule/kilt.git # Remove git worktree popd