-
Notifications
You must be signed in to change notification settings - Fork 6
70 lines (64 loc) · 1.84 KB
/
build.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
name: Build
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
pages: write
id-token: write
jobs:
build_website:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Poetry
run: curl -sSL https://install.python-poetry.org/ | python -
- name: Add Poetry to PATH
run: echo "$HOME/.poetry/bin" >> $GITHUB_PATH
- name: Install dependencies
run: poetry install
- name: Run Black
run: poetry run black --check src/
- name: Run Isort
run: poetry run isort --check src/
- name: Download ATT&CK data
run: poetry run download_attack_stix --stix20 --all -d data/attack
- name: Build website
env:
LOGURU_LEVEL: INFO
run: poetry run build-attack-sync --url-prefix "/attack-sync" --google-analytics "G-XZLBW4KBV1"
- name: Upload website artifact
uses: actions/upload-artifact@v3
with:
name: attack_sync_html
path: public/
github_pages:
# This job only runs when committing or merging to main branch.
if: github.ref_name == 'main'
needs: build_website
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Setup Pages
uses: actions/configure-pages@v2
- name: Download website build
uses: actions/download-artifact@v3
with:
name: attack_sync_html
path: public/
- name: Upload website to GitHub pages
uses: actions/upload-pages-artifact@v1
with:
path: ./public
- name: Deploy GitHub Pages
id: deployment
uses: actions/deploy-pages@v1