|
28 | 28 | - run: npm ci
|
29 | 29 | - run: npm test
|
30 | 30 |
|
31 |
| - build-storybook: |
| 31 | + deploy-static: |
32 | 32 | runs-on: ubuntu-latest
|
| 33 | + environment: CI |
33 | 34 |
|
34 | 35 | strategy:
|
35 | 36 | matrix:
|
|
45 | 46 | cache: "npm"
|
46 | 47 | - run: npm ci
|
47 | 48 | - 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: ${{ secrets.AWS_S3_BUCKET }}/testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/ |
| 53 | + - name: Upload storybook static |
| 54 | + uses: jakejarvis/[email protected] |
50 | 55 | 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 | + |
| 76 | + - name: Comment PR with links to deployed static on success |
| 77 | + if: ${{ success() }} |
| 78 | + uses: thollander/actions-comment-pull-request@v2 |
| 79 | + with: |
| 80 | + message: | |
| 81 | + ### :white_check_mark: Successfully deployed static |
| 82 | +
|
| 83 | + - [Docs website](https://storage.yandexcloud.net/testplane-ci/testplane-docs/website-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/index.html) |
| 84 | + - [Storybook](https://storage.yandexcloud.net/testplane-ci/testplane-docs/storybook-static/${{ github.run_id }}-${{ github.run_number }}-${{ github.run_attempt }}/index.html) |
| 85 | + comment_tag: deployment_status |
| 86 | + |
| 87 | + - name: Comment PR that static wasn't deployed on failure |
| 88 | + if: ${{ failure() }} |
| 89 | + uses: thollander/actions-comment-pull-request@v2 |
| 90 | + with: |
| 91 | + message: | |
| 92 | + ### :x: Failed to deploy static |
| 93 | +
|
| 94 | + Please check the workflow logs for details. |
| 95 | + comment_tag: deployment_status |
0 commit comments