-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update publish docs to use a community action (#614)
Use https://github.com/peaceiris/actions-gh-pages to publish to the gh-pages branch. This will hopefully remove some config and tokens that we need to save now that GH Actions support pushing branch via the GITHUB_TOKEN secret See: peaceiris/actions-gh-pages#9
- Loading branch information
Showing
5 changed files
with
991 additions
and
849 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ jobs: | |
publish-docs: | ||
|
||
runs-on: ubuntu-latest | ||
if: github.repository == 'ExpediaGroup/graphql-kotlin' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
@@ -21,18 +22,23 @@ jobs: | |
with: | ||
node-version: 12 | ||
|
||
- name: Run npm commands | ||
if: github.repository == 'ExpediaGroup/graphql-kotlin' | ||
- uses: actions/cache@v1 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('website/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Build website | ||
run: | | ||
cd website | ||
npm install | ||
git config --global user.name "${GH_USERNAME}" | ||
echo "machine github.com login ${GH_USERNAME} password ${{ secrets.EG_CI_USER_TOKEN }}" > ~/.netrc | ||
GIT_USER="${GH_USERNAME}" npm run publish-gh-pages | ||
env: | ||
CI: true | ||
CURRENT_BRANCH: master | ||
|
||
# The following settings will only work with the personal access token we are using | ||
# Until GH Actions have a way to publish directly we are using this method | ||
GH_USERNAME: eg-oss-ci | ||
npm run build | ||
- name: Deploy GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./build | ||
user_name: eg-oss-ci | ||
user_email: [email protected] |
Oops, something went wrong.