-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (54 loc) · 1.64 KB
/
deploy_to_iis.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
name: Run Github-hosted runner for build and self-hosted runner deployment to IIS
# Author: Yassine Hamadou Mounkaila
on:
push:
branches:
- production
workflow_dispatch: # Allows you to run this workflow manually from the Actions tab
jobs:
build-and-deploy:
runs-on: self-hosted
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install Dependencies
run: |
npm install --legacy-peer-deps
npm install cross-env
- name: Heap size
run: |
set "NODE_OPTIONS=--max_old_space_size=4096"
- name: Build the project
run: npm run ciBuild
# upload artifact
- name: Upload artifact for deployment job
uses: actions/upload-artifact@v3
with:
name: build
path: build
- name: Cache
uses: actions/[email protected]
with:
# A list of files, directories, and wildcard patterns to cache and restore
path: node_modules
# An explicit key for restoring and saving the cache
key: node
deploy:
runs-on: self-hosted
needs: build-and-deploy
steps:
- name: Download artifact from build job
uses: actions/download-artifact@v3
with:
name: build
path: build
- name: Copy build folder to the website folder
run: xcopy /Y /S /I build\* C:\inetpub\wwwroot\esms\