Skip to content

Commit 852a8cd

Browse files
chiedoJamesMGreene
andauthored
Use self-hosted runners for docs-internal (github#17442)
Use self hosted runners for docs-internal Co-authored-by: chiedo <chiedo@users.noreply.github.com> Co-authored-by: James M. Greene <JamesMGreene@github.com>
1 parent 254e82e commit 852a8cd

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131

3232
test:
3333
needs: see_if_should_skip
34-
runs-on: ubuntu-latest
34+
# Run on self-hosted if the private repo or ubuntu-latest if the public repo
35+
# See pull # 17442 in the private repo for context
36+
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
3537
timeout-minutes: 60
3638
strategy:
3739
fail-fast: false
@@ -72,15 +74,15 @@ jobs:
7274
name: Install dependencies
7375
run: npm ci
7476

75-
- name: Clone early access
76-
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository == 'github/docs-internal' }}
77+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository == 'github/docs-internal' }}
78+
name: Clone early access
7779
run: npm run heroku-postbuild
7880
env:
7981
DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
8082
GIT_BRANCH: ${{ github.ref }}
8183

82-
- name: Run build script
83-
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
84+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
85+
name: Run build script
8486
run: npm run build
8587

8688
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}

script/early-access/clone-for-build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const earlyAccessRepoName = 'docs-early-access'
4949
const earlyAccessDirName = 'early-access'
5050
const earlyAccessFullRepo = `https://${DOCUBOT_REPO_PAT}@github.com/${earlyAccessOwner}/${earlyAccessRepoName}`
5151

52-
const earlyAccessCloningParentDir = os.tmpdir()
52+
// On our Azure self-hosted runners, os.tmpdir() doesn't work reliably. On Heroku, os.homedir doesn't work reliably.
53+
const earlyAccessCloningParentDir = process.env.CI ? os.homedir() : os.tmpdir()
5354
const earlyAccessCloningDir = path.join(earlyAccessCloningParentDir, earlyAccessRepoName)
5455

5556
const destinationDirNames = ['content', 'data', 'assets/images']

0 commit comments

Comments
 (0)