-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (49 loc) · 1.83 KB
/
deploy.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
name: Deploy
on: [workflow_dispatch]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # checkout this repo
- uses: actions/checkout@v3 # checkout other private repo
with:
repository: cysec-lab/DarkwebVisualizer
token: ${{ secrets.ORG_GITHUB_PAT }}
path: private
ref: "main"
- name: Move private files
run: |
ls -a | grep -v -E '^\.$|^\.\.$|^private$|^\.git$|^\.github|^README.md$$' | xargs rm -rf
ls -d private/* private/.* | grep -v -E '^private/\.$|^private/\.\.$|^private/\.git$|^private/\.github$|^private/README.md$' | xargs -i mv {} .
rm -rf private
rm public/nodes.json public/edges.json
- name: Commit and Push
continue-on-error: true
run: |
git config --global user.name "actions-user"
git config --global user.email "[email protected]"
git add .
git commit -m "deploy: ${{ github.sha }}"
git push origin main
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache node_modules
id: node_modules_cache_id
uses: actions/cache@v3
with:
path: node_modules
key: node-v${{ matrix.node-version }}-deps-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
- name: Install Dependencies
run: yarn install --frozen-lockfile
- name: Replace package.json content
run: sed -i -e 's/--mode dev/--mode production/g' package.json
- name: Build
run: yarn build && echo "dw.cysec-lab.org" > dist/CNAME
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist