Skip to content

Commit dadd5ea

Browse files
authored
feat: support uploading static resources to aws s3 (#17)
* feat: support uploading static resources to aws s3 * fix: dark animation * fix: test ci should set up the NODE_ENV to test
1 parent 6d63a72 commit dadd5ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+48556
-5104
lines changed

.eslintignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.next
22
node_modules
3-
next.config.js
3+
next.config.js
4+
**.js

.github/workflows/deploy_dev.yml

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ jobs:
1313
env:
1414
SSH_TARGET: 54.206.53.213
1515
NODE_ENV: production
16+
ENVIRONMENT: test
17+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
18+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
19+
1620

1721
steps:
1822
- name: Checkout code
@@ -32,5 +36,5 @@ jobs:
3236
3337
- name: Deploy to EC2
3438
run: |
35-
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem admin@$SSH_TARGET "cd space/AppFlowy-Website && git fetch && git reset --hard origin/${{ steps.branch.outputs.branch }} && pnpm install && pnpm run build && node run-script.js" || { echo "Failed to execute the command"; exit 1; }
39+
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem admin@$SSH_TARGET "cd space/AppFlowy-Website && git fetch && git reset --hard origin/${{ steps.branch.outputs.branch }} && pnpm install && pnpm run build && pnpm run upload:s3 && node run-script.js" || { echo "Failed to execute the command"; exit 1; }
3640

.github/workflows/deploy_prod.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ jobs:
1818
env:
1919
SSH_TARGET: 54.206.53.213
2020
NODE_ENV: production
21+
ENVIRONMENT: production
22+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
23+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
2124

2225
steps:
2326
- name: Checkout code
@@ -33,4 +36,4 @@ jobs:
3336
3437
- name: Deploy to EC2 (Main)
3538
run: |
36-
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem admin@$SSH_TARGET "cd space/AppFlowy-Website && git fetch && git reset --hard origin/${{ inputs.branch }} && pnpm install && pnpm run build && node run-script.js" || { echo "Failed to execute the command"; exit 1; }
39+
ssh -o StrictHostKeyChecking=no -i ~/.ssh/id_rsa.pem admin@$SSH_TARGET "cd space/AppFlowy-Website && git fetch && git reset --hard origin/${{ inputs.branch }} && pnpm install && pnpm run build && pnpm run upload:s3 && node run-script.js" || { echo "Failed to execute the command"; exit 1; }

.github/workflows/test.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
test:
1414
runs-on: ubuntu-latest
1515

16+
env:
17+
NODE_ENV: test
18+
1619
steps:
1720
- name: Checkout source code
1821
uses: actions/checkout@v2
@@ -27,12 +30,12 @@ jobs:
2730
pnpm install
2831
- name: Build
2932
run: |
30-
pnpm run build
33+
NODE_ENV=test pnpm run build
3134
- name: Run lint
3235
run: |
3336
pnpm run lint
3437
- name: Run tests
3538
run: |
36-
pnpm run start &
39+
NODE_ENV=test pnpm run start &
3740
pnpm run test:headless
3841

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ next-env.d.ts
3636

3737
cypress/videos
3838

39-
**/*.log
39+
**/*.log

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/
66
First, run the development server:
77

88
```bash
9-
npm run dev
10-
# or
11-
yarn dev
12-
# or
13-
pnpm dev
9+
pnpm run dev
1410
```
1511

1612
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
@@ -20,6 +16,13 @@ You can start editing the page by modifying `app/page.tsx`. The page auto-update
2016
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and
2117
load Inter, a custom Google Font.
2218

19+
## How to modify the content?
20+
21+
### Static Text Content
22+
23+
- `lib/config/home.tsx` - Home page content
24+
- `lib/config/pages.tsx` - Other pages content
25+
2326
## Deploy
2427

2528
### Automatic Testing Environment Deployment

app/appflowy-blocks/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Page() {
2121
</svg>
2222
</div>
2323
</div>
24-
<div className={'desc'}>{blocksPageConfig.desc}</div>
24+
<div className={'desc'}>{blocksPageConfig.subtitle}</div>
2525
<AppflowyBlocks />
2626
</div>
2727
);

app/contributors/page.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function Page() {
99
<div className={'contributors-page'}>
1010
<div className={'ellipse'} />
1111
<div className={'title'}>
12-
{contributorsPageConfig.title1}
12+
{contributorsPageConfig.mainTitle}
1313
<div className={'line'}>
1414
<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 174 6' fill='none'>
1515
<path
@@ -21,10 +21,10 @@ function Page() {
2121
</svg>
2222
</div>
2323
</div>
24-
<div className={'desc'}>{contributorsPageConfig.desc}</div>
24+
<div className={'desc'}>{contributorsPageConfig.subtitle}</div>
2525
<ContributorsList />
2626
<div className={'title learn-more'}>
27-
{contributorsPageConfig.title2}
27+
{contributorsPageConfig.learnMoreTitle}
2828
<div className={'line'}>
2929
<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 155 6' fill='none'>
3030
<path
File renamed without changes.

app/globals.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ body {
2020
@apply text-black dark:text-white;
2121
font-family: "Inter", sans-serif;
2222
font-size: 16px;
23-
background: #EAE6FF;
23+
@apply bg-light-blue-gray;
24+
@apply dark:bg-night-blue;
2425
}
2526

2627
@media screen and (max-width: 768px) {

app/join/page.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Page() {
2121
</svg>
2222
</div>
2323
</div>
24-
<div className={'desc'}>{joinPageConfig.desc}</div>
24+
<div className={'desc'}>{joinPageConfig.subtitle}</div>
2525
<Link href={'/join#opening'}>
2626
<div className={'download-btn'}>Open Position</div>
2727
</Link>
@@ -40,7 +40,7 @@ function Page() {
4040
</div>
4141
</div>
4242
<div className={'title opening'} id={'opening'}>
43-
{joinPageConfig.title1}
43+
{joinPageConfig.currentJobTitle}
4444
<div className={'circle'}>
4545
<svg xmlns='http://www.w3.org/2000/svg' width='100%' height='100%' viewBox='0 0 163 90' fill='none'>
4646
<path

0 commit comments

Comments
 (0)