-
Notifications
You must be signed in to change notification settings - Fork 144
68 lines (56 loc) · 1.77 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
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@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'pip'
- name: Setup Node.js environment
uses: actions/setup-node@v3
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: 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: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/master' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output
cname: attack.mitre.org