-
Notifications
You must be signed in to change notification settings - Fork 17
101 lines (87 loc) · 3.67 KB
/
push.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build
on: [push]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
steps:
- uses: linz/action-typescript@v2
build-deploy:
runs-on: ubuntu-latest
concurrency: deploy-${{ github.ref }}
permissions:
id-token: write
contents: write
steps:
- uses: linz/action-typescript@v2
# pulls all tags (needed for lerna to correctly version)
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* # see https://stackoverflow.com/a/60184319/9285308
- name: Check Dependencies
run: node scripts/detect.unlinked.dep.js
- name: (Prod) Create tag
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
CURRENT_VERSION=$(node -p "require('./lerna.json').version")
git tag v${CURRENT_VERSION} -m v${CURRENT_VERSION}
git push --tags
- name: Deploy - Bundle
if: github.ref != 'refs/heads/master' || github.repository != 'linz/basemaps'
run: npx lerna run bundle --stream
- name: (NonProd) Configure AWS Credentials
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps'
uses: aws-actions/[email protected]
with:
aws-region: ap-southeast-2
mask-aws-account-id: true
role-to-assume: ${{ secrets.AWS_ROLE_NON_PROD }}
- name: (NonProd) Deploy
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps'
run: |
npx lerna run bundle --stream
npm pack --workspaces
cp *.tgz packages/cli
npx lerna run deploy:deploy --stream
env:
SPLIT_IO_KEY: ${{secrets.SPLIT_IO_KEY_NON_PROD}}
GOOGLE_ANALYTICS: ${{secrets.GOOGLE_ANALYTICS_NON_PROD}}
NODE_ENV: 'dev'
- name: (NonProd) After Deploy Smoke Test
if: github.ref == 'refs/heads/master' && github.repository == 'linz/basemaps'
run: |
cd packages/smoke
node --test
- name: (Prod) Configure AWS Credentials
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
uses: aws-actions/[email protected]
with:
aws-region: ap-southeast-2
mask-aws-account-id: true
role-to-assume: ${{ secrets.AWS_ROLE_PROD }}
- name: (Prod) Deploy
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
run: |
npx lerna run bundle --stream
npm pack --workspaces
cp *.tgz packages/cli
npx lerna run deploy:deploy --stream
env:
NODE_ENV: 'production'
GOOGLE_ANALYTICS: ${{secrets.GOOGLE_ANALYTICS_PROD}}
SPLIT_IO_KEY: ${{secrets.SPLIT_IO_KEY_PROD}}
- name: (Prod) Create github release
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
run: npx conventional-github-releaser -p angular
env:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: (Prod) Publish NPM
if: github.ref == 'refs/heads/master' && startsWith(github.event.head_commit.message, 'release:')
run: npx lerna publish from-git --yes
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN_LINZJS}}
- name: Benchmark
uses: blacha/hyperfine-action@v1