Skip to content

Commit

Permalink
Automatically publish from master to gh-pages (projectriff#143)
Browse files Browse the repository at this point in the history
Use GitHub actions with a custom personal access token to build the
latest commit from master and publish to gh-pages.

It seems the stock GITHUB_TOKEN secret provided by GitHub Actions is
unable to push a commit. I'd love to be wrong here.
  • Loading branch information
scothis authored Sep 4, 2019
1 parent a93386f commit ee563fa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Publish to gh-pages

on:
push:
branches:
- master

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 10
- run: npm install
working-directory: website
- run: |
git config --global user.email "${GIT_USER}@users.noreply.github.com"
git config --global user.name "Github Actions"
echo "machine github.com login ${GIT_USER} password ${GITHUB_TOKEN}" > ~/.netrc
npm run publish
working-directory: website
env:
GIT_USER: ${{secrets.GH_USER}}
GITHUB_TOKEN: ${{secrets.GH_PERSONAL_ACCESS_TOKEN}}

0 comments on commit ee563fa

Please sign in to comment.