@@ -25,11 +25,40 @@ inputs:
2525 description : " Name of the Component to deploy"
2626 required : true
2727 default : ' api'
28+ nodejs_version :
29+ description : " Node.js version, set by the CI/CD pipeline workflow"
30+ required : true
31+ NODE_AUTH_TOKEN :
32+ description : " Token for access to github package registry"
33+ required : true
2834
2935runs :
3036 using : composite
3137
3238 steps :
39+ - name : Checkout
40+ uses : actions/checkout@v4
41+ - uses : actions/setup-node@v4
42+ with :
43+ node-version : ${{ inputs.nodejs_version }}
44+ registry-url : ' https://npm.pkg.github.com'
45+
46+ - name : " Cache node_modules"
47+ uses : actions/cache@v4
48+ with :
49+ path : |
50+ **/node_modules
51+ key : ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
52+ restore-keys : |
53+ ${{ runner.os }}-node-${{ inputs.nodejs_version }}-
54+
55+ - name : Npm install
56+ working-directory : .
57+ env :
58+ NODE_AUTH_TOKEN : ${{ inputs.NODE_AUTH_TOKEN }}
59+ run : npm ci
60+ shell : bash
61+
3362 - name : Setup Proxy Name and target
3463 shell : bash
3564 run : |
5887 echo "MTLS_NAME=notify-supplier-mtls-pr$PR_NUMBER" >> $GITHUB_ENV
5988 fi
6089
90+ - name : Build ${{ inputs.apimEnv }} oas
91+ working-directory : .
92+ env :
93+ APIM_ENV : ${{ inputs.apimEnv }}
94+ shell : bash
95+ run : |
96+ if [ ${{ env.APIM_ENV }} == "internal-dev-sandbox" ] && [ ${{ inputs.buildSandbox }} == true ]
97+ then
98+ echo "Building sandbox OAS spec"
99+ make build-json-oas-spec APIM_ENV=sandbox
100+ else
101+ echo "Building env specific OAS spec"
102+ make build-json-oas-spec APIM_ENV=${{ env.APIM_ENV }}
103+ fi
104+
105+ if [[ $APIM_ENV == *-pr ]]; then
106+ echo "Removing pr suffix from APIM_ENV after building OAS and calling proxygen"
107+ APIM_ENV=$(echo "$APIM_ENV" | sed 's/-pr$//')
108+ fi
109+ echo "APIM_ENV=$APIM_ENV" >> $GITHUB_ENV
110+
61111 - name : Upload OAS Spec
62112 uses : actions/upload-artifact@v4
63113 with :
66116
67117 - name : Trigger deploy proxy
68118 env :
69- APIM_ENV : ${{ inputs.apimEnv }}
70119 APP_CLIENT_ID : ${{ env.APP_CLIENT_ID }}
71120 APP_PEM_FILE : ${{ env.APP_PEM_FILE }}
72121 shell : bash
0 commit comments