-
Notifications
You must be signed in to change notification settings - Fork 7
103 lines (98 loc) · 4.11 KB
/
pr-boxel-host.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
102
103
name: CI [boxel-host]
on:
pull_request:
paths:
- "packages/host/**"
- "packages/boxel-ui/**"
- "packages/boxel-icons/**"
- ".github/workflows/pr-boxel-host.yml"
- "package.json"
- "pnpm-lock.yaml"
permissions:
contents: read
issues: read
checks: write
pull-requests: write
id-token: write
statuses: write
jobs:
check-if-requires-preview:
name: Check if a preview deploy is required
runs-on: ubuntu-latest
outputs:
boxel-host-files-changed: ${{ steps.boxel-host-files-that-changed.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
- name: Get boxel-host files that changed
id: boxel-host-files-that-changed
uses: tj-actions/changed-files@v39
with:
files: |
.github/workflows/build-host.yml
.github/workflows/deploy-host.yml
.github/workflows/pr-boxel-host.yml
packages/host/**
packages/boxel-ui/**
packages/boxel-icons/**
deploy-host-preview-staging:
name: Deploy a boxel-host staging preview to S3
runs-on: ubuntu-latest
# github.event.pull_request.head.repo.full_name == github.repository: true if pr is from the original repo, false if it's from a fork
# github.head_ref: the branch that the pull request is from. only appears on pull_request events
if: github.event.pull_request.head.repo.full_name == github.repository && github.head_ref && needs.check-if-requires-preview.outputs.boxel-host-files-changed == 'true'
needs: check-if-requires-preview
concurrency: deploy-host-preview-staging
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::680542703984:role/boxel-host
aws-region: us-east-1
- name: Deploy boxel-host preview
uses: ./.github/actions/deploy-ember-preview
env:
OWN_REALM_URL: https://realms-staging.stack.cards/experiments/
RESOLVED_BASE_REALM_URL: https://realms-staging.stack.cards/base/
MATRIX_URL: https://matrix-staging.stack.cards
MATRIX_SERVER_NAME: stack.cards
EXPERIMENTAL_AI_ENABLED: true
STRIPE_PAYMENT_LINK: https://buy.stripe.com/test_9AQdUjgaDePb8lWcMN
S3_PREVIEW_BUCKET_NAME: boxel-host-preview.stack.cards
AWS_S3_BUCKET: boxel-host-preview.stack.cards
AWS_REGION: us-east-1
AWS_CLOUDFRONT_DISTRIBUTION: EU4RGLH4EOCHJ
with:
package: boxel-host
environment: staging
deploy-host-preview-production:
name: Deploy a boxel-host production preview to S3
runs-on: ubuntu-latest
# github.event.pull_request.head.repo.full_name == github.repository: true if pr is from the original repo, false if it's from a fork
# github.head_ref: the branch that the pull request is from. only appears on pull_request events
if: github.event.pull_request.head.repo.full_name == github.repository && github.head_ref && needs.check-if-requires-preview.outputs.boxel-host-files-changed == 'true'
needs: check-if-requires-preview
concurrency: deploy-host-preview-production
steps:
- uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::120317779495:role/boxel-host
aws-region: us-east-1
- name: Deploy boxel-host preview
uses: ./.github/actions/deploy-ember-preview
env:
OWN_REALM_URL: https://app.boxel.ai/experiments/
RESOLVED_BASE_REALM_URL: https://app.boxel.ai/base/
MATRIX_URL: https://matrix.boxel.ai
MATRIX_SERVER_NAME: boxel.ai
EXPERIMENTAL_AI_ENABLED: true
STRIPE_PAYMENT_LINK: https://buy.stripe.com/00g29k8zLgI35xK000
S3_PREVIEW_BUCKET_NAME: boxel-host-preview.boxel.ai
AWS_S3_BUCKET: boxel-host-preview.boxel.ai
AWS_REGION: us-east-1
AWS_CLOUDFRONT_DISTRIBUTION: E2PZR9CIAW093B
with:
package: boxel-host
environment: production