Merge branch 'cleanup' into production #137
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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\ |