-
Notifications
You must be signed in to change notification settings - Fork 0
58 lines (51 loc) · 1.8 KB
/
deploy-trip-tick.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
name: Trip-Tick Deploy
on:
push:
branches: [main]
paths:
- 'apps/trip-tick/**'
- 'packages/client/**'
- 'packages/apps/**'
- '.github/workflows/deploy-trip-tick.yml'
jobs:
build-and-deploy-trip-tick:
name: Build and deploy trip-tick
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/[email protected]
with:
version: 8.12.1
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: '18'
cache: pnpm
- name: Install dependencies
run: pnpm install --filter @trip-tick.biscuits/web...
- name: Build trip-tick
run: pnpm --filter @trip-tick.biscuits/web... run build
env:
VITE_API_ORIGIN: ${{ vars.API_ORIGIN }}
VITE_HOME_ORIGIN: ${{ vars.HOME_ORIGIN }}
VITE_PUBLIC_URL: https://trip-tick.biscuits.club
VITE_STRIPE_PUBLISHABLE_KEY: ${{ vars.STRIPE_PUBLISHABLE_KEY }}
- name: Deploy trip-tick to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET_TRIP_TICK }}
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYER_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYER_AWS_SECRET_ACCESS_KEY }}
SOURCE_DIR: './apps/trip-tick/web/dist'
- name: Invalidate CloudFront cache
uses: chetan/invalidate-cloudfront-action@v2
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DEPLOYER_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DEPLOYER_AWS_SECRET_ACCESS_KEY }}
DISTRIBUTION: ${{ secrets.CLOUDFRONT_ID_TRIP_TICK }}
PATHS: '/*'
AWS_REGION: 'us-east-1'