diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index a9a1d9441b936..0000000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,95 +0,0 @@ -name: CI - -on: - push: - branches: - - main - pull_request: - workflow_dispatch: - -env: - FORCE_COLOR: 2 - -jobs: - lint: - name: Lint - runs-on: ubuntu-latest - - steps: - - name: Clone repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Install npm dependencies - run: npm ci - - - name: Lint - run: | - echo "::add-matcher::.github/workflows/remark-lint-problem-matcher.json" - npm run lint - - build: - name: Node on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest] - - steps: - - name: Clone repository - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: npm - - - name: Install NPM dependencies - run: npm ci - - - name: Restore Next.js cache - uses: actions/cache/restore@v3 - with: - path: | - ${{ github.workspace }}/.next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- - - - name: Build Next.js - run: npm run build - env: - NODE_OPTIONS: '--max_old_space_size=4096' - - - name: Save Next.js cache - uses: actions/cache/save@v3 - with: - path: | - ${{ github.workspace }}/.next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('.next/cache/eslint') }} - - - name: Export Next.js - run: npm run export - - # We don't generate non-translated pages. So if a certain page on /en/ exists - # but not on /de/ or any other language, it will 404. This is handled on nginx level - # Prior to this migration Metalsmith would copy the English version of a page to all - # the non-translated pages. "Fooling" the 404 by basically adding i18n context with - # an untranslated page. This would be very exhaustive with Next.js on SCG mode - # but it's something we want to do once we decide upon using Next.js on SSR mode or - # if we decide upon using Vercel's infrastructure as generating a copy of every English page - # on the file system is very resource exhaustive. - # - name: Run linkinator - # uses: JustinBeckwith/linkinator-action@v1 - # with: - # linksToSkip: '^(?!http://localhost)' - # paths: en - # recurse: true - # serverRoot: build - # verbosity: error diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index bbc767c9a9e40..0000000000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: 'CodeQL' - -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - - cron: '0 0 * * 0' - workflow_dispatch: - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: 'javascript' - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml new file mode 100644 index 0000000000000..75e8ee4af2043 --- /dev/null +++ b/.github/workflows/github-pages.yml @@ -0,0 +1,77 @@ +name: Build and Deploy to GitHub Pages + +on: + push: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true + +jobs: + build: + name: Build on ${{ matrix.os }} + runs-on: ubuntu-latest + steps: + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Install NPM packages + run: npm ci + + - name: Setup GitHub Pages + uses: actions/configure-pages@v3 + with: + static_site_generator: next + + - name: Restore Next.js cache + uses: actions/cache/restore@v3 + with: + path: | + .next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + + - name: Build Next.js + run: npm run build + env: + NODE_OPTIONS: '--max_old_space_size=4096' + + - name: Save Next.js cache + uses: actions/cache/save@v3 + with: + path: | + .next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('.next/cache/eslint') }} + + - name: Export Next.js static files + run: npm run export + + - name: Upload Artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./build + + deploy: + name: Deploy to GitHub Pages + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000000000..b7533612aaec7 --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,71 @@ +name: Pull Request Checks + +on: + pull_request: + workflow_dispatch: + merge_group: + +env: + FORCE_COLOR: 2 + +jobs: + lint: + name: Lint on ${{ matrix.os }} + runs-on: ubuntu-latest + + steps: + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Install NPM packages + run: npm ci + + - name: Run Linting + run: npm run lint + + build: + name: Build on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest] + + steps: + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + cache: npm + + - name: Install NPM packages + run: npm ci + + - name: Restore Next.js cache + uses: actions/cache/restore@v3 + with: + path: | + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- + + - name: Build Next.js + run: npm run build + env: + NODE_OPTIONS: '--max_old_space_size=4096' + + - name: Save Next.js cache + uses: actions/cache/save@v3 + with: + path: | + ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('.next/cache/eslint') }} diff --git a/.github/workflows/remark-lint-problem-matcher.json b/.github/workflows/remark-lint-problem-matcher.json deleted file mode 100644 index cfb281310a9a0..0000000000000 --- a/.github/workflows/remark-lint-problem-matcher.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "problemMatcher": [ - { - "owner": "remark-lint", - "pattern": [ - { - "regexp": "^(?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)*$", - "file": 1 - }, - { - "regexp": "^\\s+(?:\\d+:\\d+-)?(\\d+):(\\d+)\\s+\\S*(error|warning|info)\\S*\\s+(.+)\\s+(\\S+)\\s+(?:\\S+)$", - "line": 1, - "column": 2, - "severity": 3, - "message": 4, - "code": 5, - "loop": true - } - ] - } - ] -}