Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update publish docs to use a community action #614

Merged
merged 1 commit into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/pr-check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
check-docs:

runs-on: ubuntu-latest
if: github.repository == 'ExpediaGroup/graphql-kotlin'

steps:
- uses: actions/checkout@v2
Expand All @@ -21,8 +22,14 @@ 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
Expand Down
30 changes: 18 additions & 12 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ jobs:
publish-docs:

runs-on: ubuntu-latest
if: github.repository == 'ExpediaGroup/graphql-kotlin'

steps:
- uses: actions/checkout@v2
Expand All @@ -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: oss@expediagroup.com
Loading