-
Notifications
You must be signed in to change notification settings - Fork 23
68 lines (65 loc) · 2.52 KB
/
alpha.miku.gg.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
name: alpha.miku.gg deployment
on:
push:
branches:
- master
paths:
- apps/interactor/**
- packages/**
- .github/workflows/alpha.miku.gg.yml
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
pull_request:
types: [opened, synchronize, reopened, closed]
branches:
- master
paths:
- apps/interactor/**
- packages/**
- .github/workflows/alpha.miku.gg.yml
- package.json
- pnpm-lock.yaml
- pnpm-workspace.yaml
jobs:
build_and_test_job:
if: github.event_name != 'push' || github.ref != 'refs/heads/master'
runs-on: ubuntu-latest
name: Build and Test Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Install
run: npm i -g pnpm && pnpm install --no-frozen-lockfile && pnpm test && pnpm run build --scope=@mikugg/interactor
deploy_job:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
name: Deploy Job
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Setup AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-west-2
- name: Install
run: npm i -g pnpm && pnpm install --no-frozen-lockfile && pnpm run build --scope=@mikugg/interactor
env:
VITE_SERVICES_ENDPOINT: ${{ secrets.VITE_SERVICES_ENDPOINT }}
VITE_CARD_ENDPOINT: ${{ secrets.VITE_BOT_DIRECTORY_ENDPOINT }}
VITE_ASSETS_ENDPOINT: ${{ secrets.VITE_ASSETS_DIRECTORY_ENDPOINT }}
VITE_ASSETS_UPLOAD_URL: ${{ secrets.VITE_ASSETS_UPLOAD_URL }}
VITE_BACKGROUND_SEARCH_ENDPOINT: ${{ secrets.VITE_BACKGROUND_SEARCH_ENDPOINT }}
VITE_CHARACTER_SEARCH_ENDPOINT: ${{ secrets.VITE_CHARACTER_SEARCH_ENDPOINT }}
VITE_GTM_ID: ${{ secrets.VITE_GTM_ID}}
VITE_SENTRY_DSN: ${{ secrets.VITE_SENTRY_DSN}}
- name: Deploy to S3
run: aws s3 sync apps/interactor/dist ${{ secrets.S3_BUCKET_ALPHA }} --delete
- name: Set Cache-Control
run: aws s3 cp apps/interactor/dist/index.html ${{ secrets.S3_BUCKET_ALPHA }}/index.html --metadata-directive REPLACE --cache-control max-age=0
- name: Invalidate Cloudfront distribution
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DISTRIBUTION_ALPHA }} --paths "/*"