Skip to content

Commit a19d23b

Browse files
authored
Merge branch 'main' into desktop-fork-flow
2 parents 39d1707 + cedffd8 commit a19d23b

2,817 files changed

Lines changed: 27959 additions & 16636 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Make sure the Docker container still builds
2+
3+
name: Build Docker image
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
branches-ignore:
11+
- translations
12+
13+
env:
14+
CI: true
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Check out repo
21+
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
22+
- name: Build the container
23+
run: docker build .
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Check for External Repo Sync PR
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- reopened
8+
branches:
9+
- main
10+
11+
jobs:
12+
invalid-repo-sync-check:
13+
name: Close external Repo Sync PRs
14+
if: ${{ github.repository == 'github/docs' && github.ref == 'refs/heads/repo-sync' }}
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9
18+
with:
19+
github-token: ${{ secrets.DOCUBOT_FR_PROJECT_BOARD_WORKFLOWS_REPO_ORG_READ_SCOPES }}
20+
script: |
21+
22+
const prCreator = context.payload.sender.login
23+
24+
// If the PR creator is the expected account, stop now
25+
if (prCreator === 'Octomerger') {
26+
return
27+
}
28+
29+
try {
30+
await github.teams.getMembershipForUserInOrg({
31+
org: 'github',
32+
team_slug: 'employees',
33+
username: prCreator
34+
})
35+
36+
// If the PR creator is a GitHub employee, stop now
37+
return
38+
} catch (err) {
39+
// An error will be thrown if the user is not a GitHub employee.
40+
// That said, we still want to proceed anyway!
41+
}
42+
43+
const pr = context.payload.pull_request
44+
const { owner, repo } = context.repo
45+
46+
// Close the PR and add the invalid label
47+
await github.issues.update({
48+
owner: owner,
49+
repo: repo,
50+
issue_number: pr.number,
51+
labels: ['invalid'],
52+
state: 'closed'
53+
})
54+
55+
// Comment on the PR
56+
await github.issues.createComment({
57+
owner: owner,
58+
repo: repo,
59+
issue_number: pr.number,
60+
body: "Please leave this `repo-sync` branch to the robots!\n\nI'm going to close this pull request now, but feel free to open a new issue or ask any questions in [discussions](https://github.com/github/docs/discussions)!"
61+
})

.github/workflows/test-translations.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
with:
1818
ref: translations # check out the 'translations' branch
1919

20+
- name: Check out tip of main
21+
run: git fetch --depth=1 origin main
22+
2023
- name: Setup node
2124
uses: actions/setup-node@c46424eee26de4078d34105d3de3cc4992202b1e
2225
with:
@@ -41,6 +44,9 @@ jobs:
4144
- name: Run linter
4245
run: npx eslint .
4346

47+
- name: Lint translated content
48+
run: npm run lint-translation
49+
4450
- name: Check dependencies
4551
run: npm run check-deps
4652

.github/workflows/triage-stale-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
- uses: actions/stale@af4072615903a8b031f986d25b1ae3bf45ec44d4
1313
with:
1414
repo-token: ${{ secrets.GITHUB_TOKEN }}
15-
stale-pr-message: 'This PR is stale because it has been open 7 days with no activity and will be automatically closed in 3 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
16-
days-before-stale: 7
15+
stale-pr-message: 'This PR is stale because it has been open 21 days with no activity and will be automatically closed in 10 days. To keep this PR open, update the PR by adding a comment or pushing a commit.'
16+
days-before-stale: 21
1717
days-before-close: 10
1818
stale-pr-label: 'stale'
1919
exempt-pr-labels: 'never-stale'

.github/workflows/triage-unallowed-contributions.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ jobs:
7878
with:
7979
github-token: ${{secrets.GITHUB_TOKEN}}
8080
script: |
81-
constFilesArr = [
81+
const badFilesArr = [
8282
'translations/**',
8383
'lib/rest/static/**',
8484
'.github/workflows/**',

Dockerfile

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,22 @@
11
# This Dockerfile can be used for docker-based deployments to platforms
22
# like Now or Moda, but it is currently _not_ used by our Heroku deployments
3-
# It uses three multi-stage builds: `installation`, `bundles`, and the main build.
3+
# It uses two multi-stage builds: `install` and the main build to keep the image size down.
44

55
# --------------------------------------------------------------------------------
6-
# INSTALLATION IMAGE
7-
# A temporary image that installs production-only dependencies
6+
# INSTALL IMAGE
7+
# A temporary image that installs production-only dependencies and builds the production-ready front-end bundles.
88

9-
FROM node:14-alpine as installation
9+
FROM node:14-alpine as install
10+
RUN apk add --no-cache python make g++
1011
ENV NODE_ENV production
1112
WORKDIR /usr/src/docs
1213
COPY package*.json ./
13-
14-
# Install the project's dependencies
15-
RUN npm ci
16-
17-
# --------------------------------------------------------------------------------
18-
# BUNDLE IMAGE
19-
# A temporary image that installs dependencies and builds the production-ready front-end bundles.
20-
21-
FROM node:14-alpine as bundles
22-
WORKDIR /usr/src/docs
23-
# Install the files used to create the bundles
24-
COPY package*.json ./
2514
COPY javascripts ./javascripts
2615
COPY stylesheets ./stylesheets
2716
COPY lib ./lib
2817
COPY webpack.config.js ./webpack.config.js
29-
# Install the project's dependencies and build the bundles
30-
RUN npm ci && npm run build
18+
RUN npm ci --production
19+
RUN npm run build
3120

3221
# --------------------------------------------------------------------------------
3322
# MAIN IMAGE
@@ -44,24 +33,31 @@ RUN chown node:node /usr/src/docs -R
4433
USER node
4534

4635
# Copy our dependencies
47-
COPY --chown=node:node --from=installation /usr/src/docs/node_modules /usr/src/docs/node_modules
36+
COPY --chown=node:node --from=install /usr/src/docs/node_modules /usr/src/docs/node_modules
4837

4938
# Copy our front-end code
50-
COPY --chown=node:node --from=bundles /usr/src/docs/dist /usr/src/docs/dist
39+
COPY --chown=node:node --from=install /usr/src/docs/dist /usr/src/docs/dist
5140

5241
# We should always be running in production mode
5342
ENV NODE_ENV production
5443

44+
# Use Lunr instead of Algolia
45+
ENV USE_LUNR true
46+
5547
# Copy only what's needed to run the server
5648
COPY --chown=node:node assets ./assets
5749
COPY --chown=node:node content ./content
5850
COPY --chown=node:node data ./data
5951
COPY --chown=node:node includes ./includes
52+
COPY --chown=node:node layouts ./layouts
6053
COPY --chown=node:node lib ./lib
6154
COPY --chown=node:node middleware ./middleware
6255
COPY --chown=node:node translations ./translations
6356
COPY --chown=node:node server.js ./server.js
6457
COPY --chown=node:node package*.json ./
58+
COPY --chown=node:node feature-flags.json ./
6559

60+
EXPOSE 80
6661
EXPOSE 443
62+
EXPOSE 4000
6763
CMD ["node", "server.js"]
20.5 KB
Loading
49.7 KB
Loading
-75 Bytes
Loading
3.53 KB
Loading

0 commit comments

Comments
 (0)