-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (51 loc) · 1.75 KB
/
deploy.yaml
File metadata and controls
60 lines (51 loc) · 1.75 KB
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
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/pushtopub_private
token: ${{ secrets.ORG_GITHUB_PAT }}
path: private
ref: "main"
- name: Move private files
run: |
ls -a | grep -v -E '^\.$|^\.\.$|^private$|^\.git$|^\.github$' | xargs rm -rf
ls -d private/* private/.* | grep -v -E '^private/\.$|^private/\.\.$|^private/\.git$|^private/\.github$' | xargs -i mv {} .
rm -rf private
- name: Commit and Push
continue-on-error: true
run: |
git config --global user.name "actions-user"
git config --global user.email "action@github.com"
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: Lint
run: yarn lint
- name: Change Vite basepath
run: |
sed -i 's/base: "."/base: "pushtopub_public"/g' vite.config.ts
- name: Build
run: yarn build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: dist