mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-07-28 19:38:24 +00:00
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io> Signed-off-by: Rui Chen <rui@chenrui.dev> Co-authored-by: RB <7775707+nitrocode@users.noreply.github.com> Co-authored-by: Rui Chen <rui@chenrui.dev>
131 lines
4.2 KiB
YAML
131 lines
4.2 KiB
YAML
name: website
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'main'
|
|
- 'release-**'
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- reopened
|
|
- synchronize
|
|
- ready_for_review
|
|
branches:
|
|
- 'main'
|
|
- 'release-**'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
changes:
|
|
outputs:
|
|
should-run-link-check: ${{ steps.changes.outputs.src == 'true' }}
|
|
if: github.event.pull_request.draft == false
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
|
|
id: changes
|
|
with:
|
|
filters: |
|
|
src:
|
|
- 'runatlantis.io/**'
|
|
- 'package-lock.json'
|
|
- 'package.json'
|
|
- '.github/workflows/website.yml'
|
|
|
|
# Check that the website builds and there's no missing links.
|
|
# This job builds the website, starts a server to serve it, and then uses
|
|
# muffet (https://github.com/raviqqe/muffet) to perform the link check.
|
|
link-check:
|
|
needs: [changes]
|
|
if: github.event.pull_request.draft == false && needs.changes.outputs.should-run-link-check == 'true'
|
|
name: Website Link Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
|
|
|
- name: markdown-lint
|
|
uses: DavidAnson/markdownlint-cli2-action@05f32210e84442804257b2a6f20b273450ec8265 # v19
|
|
with:
|
|
config: .markdownlint.yaml
|
|
globs: 'runatlantis.io/**/*.md'
|
|
|
|
- name: setup npm
|
|
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: run http-server
|
|
env:
|
|
# renovate: datasource=github-releases depName=raviqqe/muffet
|
|
MUFFET_VERSION: 2.10.6
|
|
run: |
|
|
# install raviqqe/muffet to check for broken links.
|
|
curl -Ls https://github.com/raviqqe/muffet/releases/download/v${MUFFET_VERSION}/muffet_linux_amd64.tar.gz | tar -xz
|
|
|
|
# build site
|
|
npm install
|
|
npm run website:build
|
|
|
|
# start http-server for integration testing
|
|
npx http-server runatlantis.io/.vitepress/dist &
|
|
|
|
- name: Run Playwright E2E tests
|
|
run: |
|
|
npx playwright install --with-deps
|
|
npm run e2e
|
|
|
|
- name: wait until server listened
|
|
run: curl --retry-delay 1 --retry 30 --retry-all-error http://localhost:8080
|
|
|
|
# medium.com => was being rate limited: HTTP 429
|
|
# twitter.com => too many redirections
|
|
# www.flaticon.com => 403 error
|
|
# www.freepik.com => 403 error
|
|
# ngrok.com => 406 error
|
|
- run: |
|
|
./muffet \
|
|
-e 'https://medium.com/runatlantis' \
|
|
-e 'https://dev.to/*' \
|
|
-e 'https://twitter.com/*' \
|
|
-e 'https://www.flaticon.com/*' \
|
|
-e 'https://www.freepik.com/*' \
|
|
-e 'https://ngrok.com/*' \
|
|
-e 'https://github\.com/runatlantis/atlantis/edit/main/.*' \
|
|
-e 'https://github.com/runatlantis/helm-charts#customization' \
|
|
-e 'https://github.com/sethvargo/atlantis-on-gke/blob/master/terraform/tls.tf#L64-L84' \
|
|
-e 'https://confluence.atlassian.com/*' \
|
|
--header 'User-Agent: Muffet' \
|
|
--header 'Accept-Encoding:deflate, gzip' \
|
|
--buffer-size 8192 \
|
|
--timeout 300 \
|
|
http://localhost:8080/
|
|
|
|
skip-link-check:
|
|
needs: [changes]
|
|
if: needs.changes.outputs.should-run-link-check == 'false'
|
|
name: Website Link Check
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Harden Runner
|
|
uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4
|
|
with:
|
|
egress-policy: audit
|
|
|
|
- run: 'echo "No build required"'
|