mirror of
https://github.com/mandiant/capa.git
synced 2025-12-05 20:40:05 -08:00
web: separate build and deploy, incorporate landing page (#2264)
This commit is contained in:
@@ -1,11 +1,10 @@
|
|||||||
name: deploy Capa Explorer Web to Github Pages
|
name: deploy web to GitHub Pages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
# Runs on pushes targeting the webui branch
|
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [ master, "wb/webui-actions-1" ]
|
||||||
paths:
|
paths:
|
||||||
- 'web/explorer/**'
|
- 'web/**'
|
||||||
|
|
||||||
# Allows to run this workflow manually from the Actions tab
|
# Allows to run this workflow manually from the Actions tab
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -22,10 +21,17 @@ concurrency:
|
|||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
build-landing-page:
|
||||||
environment:
|
runs-on: ubuntu-latest
|
||||||
name: github-pages
|
steps:
|
||||||
url: ${{ steps.deployment.outputs.page_url }}
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: landing-page
|
||||||
|
path: './web/public'
|
||||||
|
|
||||||
|
build-explorer:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -43,24 +49,35 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
working-directory: ./web/explorer
|
working-directory: ./web/explorer
|
||||||
- name: Lint
|
|
||||||
run: npm run lint
|
|
||||||
working-directory: ./web/explorer
|
|
||||||
- name: Format
|
|
||||||
run: npm run format:check
|
|
||||||
working-directory: ./web/explorer
|
|
||||||
- name: Run unit tests
|
|
||||||
run: npm run test
|
|
||||||
working-directory: ./web/explorer
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
working-directory: ./web/explorer
|
working-directory: ./web/explorer
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: explorer
|
||||||
|
path: './web/explorer/dist'
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
environment:
|
||||||
|
name: github-pages
|
||||||
|
url: ${{ steps.deployment.outputs.page_url }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build-landing-page, build-explorer]
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: landing-page
|
||||||
|
path: './public/'
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: explorer
|
||||||
|
path: './public/explorer'
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
uses: actions/configure-pages@v4
|
uses: actions/configure-pages@v4
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
uses: actions/upload-pages-artifact@v3
|
uses: actions/upload-pages-artifact@v3
|
||||||
with:
|
with:
|
||||||
path: './web/explorer/dist'
|
path: './public'
|
||||||
- name: Deploy to GitHub Pages
|
- name: Deploy to GitHub Pages
|
||||||
id: deployment
|
id: deployment
|
||||||
uses: actions/deploy-pages@v4
|
uses: actions/deploy-pages@v4
|
||||||
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -1,6 +1,6 @@
|
|||||||
[submodule "rules"]
|
[submodule "rules"]
|
||||||
path = rules
|
path = rules
|
||||||
url = ../capa-rules.git
|
url = ../../mandiant/capa-rules.git
|
||||||
[submodule "tests/data"]
|
[submodule "tests/data"]
|
||||||
path = tests/data
|
path = tests/data
|
||||||
url = ../capa-testfiles.git
|
url = ../../mandiant/capa-testfiles.git
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default defineConfig(({ mode }) => {
|
|||||||
const isBundle = mode === "bundle";
|
const isBundle = mode === "bundle";
|
||||||
|
|
||||||
return {
|
return {
|
||||||
base: './',
|
base: "./",
|
||||||
plugins: isBundle ? [vue(), viteSingleFile()] : [vue()],
|
plugins: isBundle ? [vue(), viteSingleFile()] : [vue()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
BIN
web/public/img/icon.ico
Normal file
BIN
web/public/img/icon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
web/public/img/icon.png
Normal file
BIN
web/public/img/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 KiB |
49
web/public/index.html
Normal file
49
web/public/index.html
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" href="img/icon.ico" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>capa</title>
|
||||||
|
<style>
|
||||||
|
/*
|
||||||
|
Josh's Custom CSS Reset
|
||||||
|
https://www.joshwcomeau.com/css/custom-css-reset/
|
||||||
|
*/
|
||||||
|
*, *::before, *::after {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
line-height: 1.5;
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
}
|
||||||
|
img, picture, video, canvas, svg {
|
||||||
|
display: block;
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
input, button, textarea, select {
|
||||||
|
font: inherit;
|
||||||
|
}
|
||||||
|
p, h1, h2, h3, h4, h5, h6 {
|
||||||
|
overflow-wrap: break-word;
|
||||||
|
}
|
||||||
|
#root, #__next {
|
||||||
|
isolation: isolate;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div style="height: 100%; display: flex; align-items: center; justify-content: center;">
|
||||||
|
<div>
|
||||||
|
<!-- this is centered -->
|
||||||
|
<img src="./img/icon.png" />
|
||||||
|
<br />
|
||||||
|
<a href="./explorer/">capa Explorer Web<a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user