-
Notifications
You must be signed in to change notification settings - Fork 306
55 lines (47 loc) · 1.62 KB
/
build-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
name: Build and Deploy
on:
push:
branches:
- "*" # Trigger on push to any branch
pull_request:
branches:
- "*" # Trigger on pull request to any branch
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "18"
- name: Customize dependencies
if: ${{ env.WL_Customization != null }}
run: |
git clone --recurse-submodules ${WL_Customization} sunbirded-portal
cp -r sunbirded-portal/images/ src/app/client/src/assets
cp -r sunbirded-portal/resourceBundles/data/ src/app/resourcebundles/
- name: Build
run: |
commit_hash=$(git rev-parse --short HEAD)
build_tag=$(echo "${{ github.ref }}" | rev | cut -d/ -f1 | rev)_${commit_hash}_${GITHUB_RUN_NUMBER}
echo "build_tag: $build_tag"
bash ./build.sh "${build_tag}" "${{ env.NODE_NAME }}" "test" true false ""
env:
NODE_NAME: "18.20.2"
- name: Archive Artifacts
uses: actions/upload-artifact@v2
with:
name: metadata
path: metadata.json
- name: Archive CDN assets if required
if: ${{ github.event.inputs.buildCdnAssests == 'true' }}
run: |
rm -rf cdn_assets
mkdir cdn_assets
cp -r src/app/dist-cdn/* cdn_assets/
zip -Jr cdn_assets.zip cdn_assets
echo "##vso[task.uploadfile]cdn_assets.zip"
env:
WL_Customization: ${{ github.event.inputs.WL_Customization }}