-
Notifications
You must be signed in to change notification settings - Fork 97
76 lines (64 loc) · 2.32 KB
/
dev.vulnrepo.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
71
72
73
74
75
76
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: BUILD DEV
on:
push:
branches: [ dev ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Node ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: cmd add version
run: cd src;echo "export const version = { number:'${GITHUB_SHA}'}" > version.ts
- name: npm install and npm run build
run: |
npm i --force
npm run build -- -c production
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: deploy_dist
path: dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
token: ${{ secrets.TOKEN }}
- name: Download build
uses: actions/download-artifact@v4
with:
name: deploy_dist
path: .
- name: cmd run
run: ls -la
- name: Angular create 404.html
run: cd vulnrepo-app;cp index.html 404.html;ls -la
- name: Add CNAME
run: cd vulnrepo-app;echo "dev.vulnrepo.com" > CNAME;ls -la
- name: Add README.md
run: cd vulnrepo-app;printf "# vulnrepo-build-dev\n\nAutomatic build of the https://github.com/kac89/vulnrepo application branch dev." > README.md
- name: Commit build
run: |
cd vulnrepo-app
git init
git config --global user.name 'github-actions[bot]'
git config --global user.email '[email protected]'
git remote add origin https://x-access-token:${{ secrets.TOKEN }}@github.com/kac89/vulnrepo-build-dev.git
git add .
git commit -m "$(date)"
git push -f -u origin master