Skip to content

Commit 0d1bf72

Browse files
committed
chore: upload static to S3
1 parent cb02ebb commit 0d1bf72

File tree

3 files changed

+39
-8
lines changed

3 files changed

+39
-8
lines changed

.github/workflows/checks.yml

+36-6
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ jobs:
2828
- run: npm ci
2929
- run: npm test
3030

31-
build-storybook:
31+
deploy-static:
3232
runs-on: ubuntu-latest
33+
environment: CI
3334

3435
strategy:
3536
matrix:
@@ -45,9 +46,38 @@ jobs:
4546
cache: "npm"
4647
- run: npm ci
4748
- run: npm run build-storybook
48-
- name: Save storybook static
49-
uses: actions/upload-artifact@v4
49+
- run: npm run build
50+
env:
51+
DOCUSAURUS_URL: https://storage.yandexcloud.net
52+
DOCUSAURUS_BASE_URL: testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/
53+
- name: Upload storybook static
54+
uses: jakejarvis/[email protected]
5055
with:
51-
name: storybook static
52-
path: |
53-
storybook-static
56+
args: --acl public-read --follow-symlinks
57+
env:
58+
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
59+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
60+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
61+
AWS_S3_ENDPOINT: https://s3.yandexcloud.net/
62+
SOURCE_DIR: 'storybook-static'
63+
DEST_DIR: 'testplane-docs/storybook-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/'
64+
- name: Upload website static
65+
uses: jakejarvis/[email protected]
66+
with:
67+
args: --acl public-read --follow-symlinks
68+
env:
69+
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
70+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
71+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
72+
AWS_S3_ENDPOINT: https://s3.yandexcloud.net/
73+
SOURCE_DIR: 'build'
74+
DEST_DIR: 'testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/'
75+
- name: Comment PR with links to deployed static
76+
uses: thollander/actions-comment-pull-request@v2
77+
with:
78+
message: |
79+
### :rocket: Successfully deployed static
80+
81+
- [Docs website](https://storage.yandexcloud.net/testplane-ci/testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/index.html)
82+
- [Storybook](https://storage.yandexcloud.net/testplane-ci/testplane-docs/storybook-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/index.html)
83+
comment_tag: deployment_status

docusaurus.config.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ const config: Config = {
99
favicon: "img/favicon.ico",
1010

1111
// Set the production url of your site here
12-
url: "https://testplane.example.com",
12+
url: process.env.DOCUSAURUS_URL ?? "https://testplane.example.com",
1313
// Set the /<baseUrl>/ pathname under which your site is served
1414
// For GitHub pages deployment, it is often '/<projectName>/'
15-
baseUrl: "/",
15+
baseUrl: process.env.DOCUSAURUS_BASE_URL ?? "/",
1616

1717
// GitHub pages deployment config.
1818
organizationName: "gemini-testing",

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"scripts": {
6+
"build": "docusaurus build",
67
"start": "docusaurus start",
78
"lint": "eslint --cache src && prettier --check .",
89
"reformat": "eslint --cache --fix src && prettier --write .",

0 commit comments

Comments
 (0)