-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (47 loc) · 1.66 KB
/
main.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
name: Main
on:
push:
branches:
- "feature/**"
- "develop"
- "release/**"
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
strategy:
matrix:
brand: ["payex", "swedbankpay"]
steps:
- uses: actions/checkout@v3
# Set brand specific variables
- name: Environment variables
id: variables
run: ./.github/scripts/variables.sh --brand ${{ matrix.brand }} --ref ${{ github.ref }}
- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Install
run: npm ci
- name: Build
run: npm run ${{ steps.variables.outputs.BUILD_SCRIPT }} -- --env basename=${{ steps.variables.outputs.BRANCH }} --env semver=${{ steps.variables.outputs.BRANCH }} --env info_version=${{ steps.variables.outputs.VERSION }} --env github_actions=true
- name: Create latest version reference file
run: |
echo "{ \"latestVersion\" : \"${{ steps.variables.outputs.BRANCH }}\" }" > ./dist/latestVersion.json
- name: Azure Login
uses: azure/login@v1.4.7
with:
creds: ${{ secrets.AZURE_CREDENTIALS_STAGE }}
- name: Azure Deploy
uses: azure/CLI@v1
with:
azcliversion: 2.43.0
inlineScript: |
az storage blob upload-batch -s dist -d \$web --account-name ${{ steps.variables.outputs.AZURE_ACCOUNT_STAGE }} --overwrite