-
Notifications
You must be signed in to change notification settings - Fork 3
66 lines (59 loc) · 2.53 KB
/
build.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
on:
push:
branches:
- main
- develop
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn
- run: yarn test
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop'
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCID }}:role/${{ secrets.AWS_DEPLOYMENT_ROLE_NAME }}
aws-region: ap-northeast-1
- name: Deploy v1
if: github.ref == 'refs/heads/main'
run: yarn deploy:v1
env:
TILESERVERLESS_SECURITY_GROUP_ID: ${{ secrets.TILESERVERLESS_SECURITY_GROUP_ID }}
TILESERVERLESS_SUBNET_ID: ${{ secrets.TILESERVERLESS_SUBNET_ID }}
TILESERVERLESS_FILESYSTEM_ACCESS_POINT_ID: ${{ secrets.TILESERVERLESS_FILESYSTEM_ACCESS_POINT_ID }}
TILESERVERLESS_FILESYSTEM_ID: ${{ secrets.TILESERVERLESS_FILESYSTEM_ID }}
CLOUDFRONT_DOMAIN_NAME: ${{ secrets.CLOUDFRONT_DOMAIN_NAME_V1 }}
TRUSTED_KEY_GROUPS: ${{ secrets.TRUSTED_KEY_GROUPS_V1 }}
CLOUDFRONT_ACM_CERTIFICATE_ARN: ${{ secrets.CLOUDFRONT_ACM_CERTIFICATE_ARN_V1 }}
- name: Deploy dev
if: github.ref == 'refs/heads/develop'
run: yarn deploy:dev
env:
TILESERVERLESS_SECURITY_GROUP_ID: ${{ secrets.TILESERVERLESS_SECURITY_GROUP_ID }}
TILESERVERLESS_SUBNET_ID: ${{ secrets.TILESERVERLESS_SUBNET_ID }}
TILESERVERLESS_FILESYSTEM_ACCESS_POINT_ID: ${{ secrets.TILESERVERLESS_FILESYSTEM_ACCESS_POINT_ID }}
TILESERVERLESS_FILESYSTEM_ID: ${{ secrets.TILESERVERLESS_FILESYSTEM_ID }}
CLOUDFRONT_DOMAIN_NAME: ${{ secrets.CLOUDFRONT_DOMAIN_NAME }}
TRUSTED_KEY_GROUPS: ${{ secrets.TRUSTED_KEY_GROUPS }}
CLOUDFRONT_ACM_CERTIFICATE_ARN: ${{ secrets.CLOUDFRONT_ACM_CERTIFICATE_ARN }}