-
Notifications
You must be signed in to change notification settings - Fork 5
79 lines (66 loc) · 2.31 KB
/
tag.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
68
69
70
71
72
73
74
75
76
77
78
79
name: Tag
on:
push:
tags:
- "*"
jobs:
build:
name: Build and deploy
runs-on: ubuntu-latest
strategy:
matrix:
brand: ["payex", "swedbankpay"]
steps:
- uses: actions/checkout@v4
# Set brand specific variables
- name: Environment variables
id: variables
run: ./.github/scripts/variables.sh --brand ${{ matrix.brand }} --ref ${{ github.ref }}
- name: Set Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: npm
- name: Install
run: npm ci
- name: Build
run: npm run ${{ steps.variables.outputs.BUILD_SCRIPT }} -- --env release=true --env basename="v/${{ steps.variables.outputs.VERSION }}" --env semver=${{ steps.variables.outputs.VERSION }} --env info_version=${{ steps.variables.outputs.VERSION }} --env github_actions=true
- name: Create latest version reference file
run: |
echo "{ \"latestVersion\" : \"${{ steps.variables.outputs.VERSION }}\" }" > ./dist/latestVersion.json
- name: Azure Login
uses: azure/[email protected]
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Azure Deploy
uses: azure/CLI@v2
with:
azcliversion: 2.43.0
inlineScript: |
az storage blob upload-batch -s dist -d \$web --account-name ${{ steps.variables.outputs.AZURE_ACCOUNT_PROD }} --overwrite
- name: Create Release
# Only create a release on one brand to avoid duplicate error
if: contains(matrix.brand, 'swedbankpay')
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Design Guide v${{ steps.variables.outputs.VERSION }}
body_path: RELEASE_NOTES.md
draft: true # Let's see if everything is nice and dandy before setting this to false
publish:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: npm
- name: Install
run: npm ci
- name: Build
run: npm run build:prod -- --env github_actions=true
- uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
access: "public"