Repository navigation
85 lines (73 loc) · 2.47 KB
/
Copy pathwebsite.yml
File metadata and controls
85 lines (73 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Website pipeline: build check on every PR, deploy to Pages from main.
#
# main is the release-controlled source for the official OWASP site. Changes
# can be validated and integrated through dev without becoming public before
# their promotion to main.
#
# The site derives its numbers (rules, domains, playbooks, contributors,
# releases, docs index) from the repository at build time, so a full clone
# is required for the contributor count.
name: website
on:
push:
branches: [main]
pull_request:
branches: [dev, main]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: website-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build site
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout with full history
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: npm
cache-dependency-path: website/package-lock.json
- name: Install dependencies
working-directory: website
run: npm ci
- name: Build
working-directory: website
run: npm run build
- name: Configure CMS
working-directory: website
env:
DECAP_GITHUB_APP_ID: ${{ vars.DECAP_GITHUB_APP_ID }}
run: npm run configure:cms
- name: Verify rendered site
working-directory: website
run: npm run verify
- name: Upload Pages artifact
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
with:
path: website/dist
deploy:
name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
needs: build
runs-on: ubuntu-latest
timeout-minutes: 10
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5