-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (101 loc) · 3.67 KB
/
Copy pathpull-request.yml
File metadata and controls
116 lines (101 loc) · 3.67 KB
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
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Pull request
on:
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
npm-ci:
name: "pnpm install"
uses: ./.github/workflows/pnpm-install.yml
check-deploy-affected:
name: "Check if a deployable app is affected"
runs-on: ubuntu-latest
needs: npm-ci
outputs:
deploy-affected: ${{ steps.check.outputs.deploy-affected }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
filter: tree:0
- name: Setup Node.js and pnpm
uses: ./.github/actions/setup-node-pnpm
- name: Install dependencies
uses: ./.github/actions/install-dependencies
- name: Derive SHAs for base and head
uses: nrwl/nx-set-shas@v4
- name: Check if a deployable app is affected
id: check
run: |
AFFECTED=$(pnpm nx show projects --affected --json)
DEPLOY_AFFECTED=$(echo "$AFFECTED" | jq -r 'any(. == "app-web" or . == "app-backend")')
echo "deploy-affected=$DEPLOY_AFFECTED" >> $GITHUB_OUTPUT
echo "Affected projects: $AFFECTED"
echo "deployable app affected: $DEPLOY_AFFECTED"
deploy:
name: "Deploy staging"
uses: ./.github/workflows/deploy.yml
needs: [npm-ci, check-deploy-affected]
if: needs.check-deploy-affected.outputs.deploy-affected == 'true'
secrets:
SA_DEPLOYER_PRIVATE_KEY: ${{ secrets.SA_STAGING_DEPLOYER_PRIVATE_KEY }}
S3_KEY_ID: ${{ secrets.S3_KEY_ID }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
SUPABASE_PROJECT_URL: ${{ secrets.SUPABASE_PROJECT_URL }}
SUPABASE_PROJECT_KEY: ${{ secrets.SUPABASE_PROJECT_KEY }}
with:
main: false
pr_number: ${{ github.event.pull_request.number }}
revision_name: pr-${{ github.event.pull_request.number }}
cloud_id: b1g9utblfaj1k8am3nmg
folder_name: languages-learner
sa_deployer_id: ajelfqpn1n9hn128gsc4
container_registry_id: crp7sst4j2jnr7n52g3g
bundle-stats:
name: "Bundle stats"
uses: ./.github/workflows/bundle-stats.yml
needs: [deploy, check-deploy-affected]
if: needs.check-deploy-affected.outputs.deploy-affected == 'true'
secrets:
S3_KEY_ID: ${{ secrets.S3_KEY_ID }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
with:
main: false
pr_number: ${{ github.event.pull_request.number }}
bundle_stats_s3_dir: /pull-requests/${{ github.event.pull_request.number }}/bundle-stats
working_directory: apps/web
e2e-tests:
name: "E2E tests"
uses: ./.github/workflows/e2e-tests.yml
needs: [deploy, check-deploy-affected]
if: needs.check-deploy-affected.outputs.deploy-affected == 'true'
secrets:
TEST_USER_AUTH_LOGIN: ${{ secrets.TEST_USER_AUTH_LOGIN }}
TEST_USER_AUTH_PASSWORD: ${{ secrets.TEST_USER_AUTH_PASSWORD }}
with:
base_url: ${{ needs.deploy.outputs.stage_url }}
precommit-checks:
name: "Pre-commit checks"
needs: npm-ci
uses: ./.github/workflows/precommit-checks.yml
components-tests:
name: "Components tests"
needs: npm-ci
uses: ./.github/workflows/components-tests.yml
check-pr-title:
name: "Check PR title"
uses: ./.github/workflows/check-pr-title.yml
deploy-storybook:
name: Deploy storybook
needs: npm-ci
uses: ./.github/workflows/storybook.yml
secrets:
S3_KEY_ID: ${{ secrets.S3_KEY_ID }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
with:
dest_path: /pull-requests/${{ github.event.pull_request.number }}/storybook
pr_number: ${{ github.event.pull_request.number }}