-
Notifications
You must be signed in to change notification settings - Fork 144
77 lines (63 loc) · 2.03 KB
/
gh-pages.yml
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
name: GitHub Pages
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- name: Setup Node.js environment
uses: actions/setup-node@v4
with:
node-version: '18.x'
- name: Upgrade pip
run: python3 -m pip install --upgrade pip
- name: Install python requirements
run: python3 -m pip install -r requirements.txt
- name: Get banner message
run: echo "BANNER_MESSAGE=$(<website-banner.production)" >> $GITHUB_ENV
- name: Toggle banner if there is a message
run: |
if [[ -z "${BANNER_MESSAGE}" ]]; then
echo "BANNER_ENABLED=False" >> $GITHUB_ENV
else
echo "BANNER_ENABLED=True" >> $GITHUB_ENV
fi
- name: Build website
run: python3 update-attack.py --attack-brand --extras --no-test-exitstatus
env:
GOOGLE_ANALYTICS: ${{ secrets.GOOGLE_ANALYTICS }}
GOOGLE_SITE_VERIFICATION: ${{ secrets.GOOGLE_SITE_VERIFICATION }}
- name: Cleanup build
run: rm -rf attack-versions
- name: Remove STIX directory
run: rm -rf output/stix/
- name: Build ATT&CK Search module
run: |
cd attack-search
npm ci
npm run build
cp dist/search_bundle.js ../output/theme/scripts/
cd ..
- name: Add BlueSky Identification
if: ${{ vars.BLUESKY_ID != '' }}
run: |
mkdir output/.well-known
echo "${{ vars.BLUESKY_ID }}" > output/.well-known/atproto-did
- name: Deploy
uses: peaceiris/actions-gh-pages@v4
if: ${{ github.ref == 'refs/heads/master' }}
with:
deploy_key: ${{ secrets.DEPLOY_KEY }}
publish_dir: ./output
cname: attack.mitre.org