-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (82 loc) · 3.3 KB
/
ci.yaml
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
name: Threadly CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
token: ${{ secrets.GH_PAT_TB }}
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Install dependencies
run: npm install
- name: Set environment variables
run: |
echo "DATABASE_URL=${{ secrets.DATABASE_URL }}" >> $GITHUB_ENV
echo "ENCRYPTION_KEY=${{ secrets.ENCRYPTION_KEY }}" >> $GITHUB_ENV
echo "COGNITO_USER_POOL_ID=${{ secrets.COGNITO_USER_POOL_ID }}" >> $GITHUB_ENV
echo "AWS_REGION=${{ secrets.AWS_REGION }}" >> $GITHUB_ENV
echo "COGNITO_WEB_CLIENT_ID=${{ secrets.COGNITO_WEB_CLIENT_ID }}" >> $GITHUB_ENV
echo "AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
echo "STRIPE_SECRET_KEY=${{ secrets.STRIPE_SECRET_KEY }}" >> $GITHUB_ENV
echo "STRIPE_WEBHOOK_SECRET=${{ secrets.STRIPE_WEBHOOK_SECRET }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_CONTACT_EMAIL=${{ secrets.NEXT_PUBLIC_CONTACT_EMAIL }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_CONTACT_LINKEDIN=${{ secrets.NEXT_PUBLIC_CONTACT_LINKEDIN }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_CONTACT_GITHUB=${{ secrets.NEXT_PUBLIC_CONTACT_GITHUB }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=${{ secrets.NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_USERNAME=${{ secrets.NEXT_PUBLIC_USERNAME }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_PASSWORD=${{ secrets.NEXT_PUBLIC_PASSWORD }}" >> $GITHUB_ENV
echo "NEXT_PUBLIC_BASE_URL=${{ secrets.NEXT_PUBLIC_BASE_URL }}" >> $GITHUB_ENV
- name: Create AWS Amplify configuration file
run: |
mkdir -p src
echo '{
"aws_project_region": "${AWS_REGION}",
"aws_cognito_region": "${AWS_REGION}",
"aws_user_pools_id": "${COGNITO_USER_POOL_ID}",
"aws_user_pools_web_client_id": "${COGNITO_WEB_CLIENT_ID}",
"oauth": {},
"aws_cognito_username_attributes": [
"EMAIL"
],
"aws_cognito_social_providers": [],
"aws_cognito_signup_attributes": [
"EMAIL",
"FAMILY_NAME",
"GIVEN_NAME"
],
"aws_cognito_mfa_configuration": "OFF",
"aws_cognito_mfa_types": [
"SMS"
],
"aws_cognito_password_protection_settings": {
"passwordPolicyMinLength": 8,
"passwordPolicyCharacters": []
},
"aws_cognito_verification_mechanisms": [
"EMAIL"
]
}' > src/amplifyconfiguration.json
- name: Run linting
run: npm run lint
- name: Run Prettier and fix formatting
run: npm run prettier --write .
- name: Run Snyk
run: npm run snyk:test
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Build application
run: npm run build