| Reporter | Github Pages | Azure Storage Static Website | AWS S3 Static Website |
|---|---|---|---|
| Allure HTML | GH Action Link | GH Action Link | GH Action Link |
| Any HTML Reports | GH Action Link | GH Action Link | GH Action Link |
Example workflow file html-reporter-s3-website)
HTML Test Results on AWS S3 Bucket with history action
Usage
main.yml Example
Place in a .yml file such as this one in your .github/workflows folder. Refer to the documentation on workflow YAML syntax here.
As of v0.2, all aws s3 sync flags are optional to allow for maximum customizability (that's a word, I promise) and must be provided by you via args:.
The following example includes optimal defaults for a public static website:
--acl public-readmakes your files publicly readable (make sure your bucket settings are also set to public).--follow-symlinkswon't hurt and fixes some weird symbolic link problems that may come up.- Most importantly,
--deletepermanently deletes files in the S3 bucket that are not present in the latest version of your repository/build. - Optional tip: If you're uploading the root of your repository, adding
--exclude '.git/*'prevents your.gitfolder from syncing, which would expose your source code history if your project is closed-source. (To exclude more than one pattern, you must have one--excludeflag per exclusion. The single quotes are also important!)
name: test-results
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Upload Playwright Test Results History to S3
uses: PavanMudigonda/playwright-html-reporter-s3-website@v1.0
id: aws_s3_test_results_upload
with:
report_url: http://${{ secrets.AWS_S3_BUCKET }}.s3-website-${{ env.AWS_REGION }}.amazonaws.com
test_results: test-results
results_history: results-history
keep_reports: 20
args: --acl public-read --follow-symlinks. # for public enabling use acl public-read # Please remove if its private bucket
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'us-east-1' # optional: defaults to us-east-1
SOURCE_DIR: 'playwright-history' # optional: defaults to entire repository
# DEST_DIR: ${{ env.GITHUB_RUN_NUMBER }}Also you can post link to the report to MS Teams
- name: Message MS Teams Channel
uses: toko-bifrost/ms-teams-deploy-card@master
with:
github-token: ${{ github.token }}
webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
custom-facts: |
- name: Github Actions Test Results
value: "http://example.com/${{ github.run_id }}"
custom-actions: |
- text: View CI Test Results
url: "https://PavanMudigonda.github.io/html-reporter-github-pages/${{ github.run_number }}"Also you can post link to the report to MS Outlook
- name: Send mail
uses: dawidd6/action-send-mail@v3
with:
# Required mail server address:
server_address: smtp.gmail.com
# Required mail server port:
server_port: 465
# Optional (recommended): mail server username:
username: ${{secrets.MAIL_USERNAME}}
# Optional (recommended) mail server password:
password: ${{secrets.MAIL_PASSWORD}}
# Required mail subject:
subject: Github Actions job result
# Required recipients' addresses:
to: obiwan@example.com,yoda@example.com
# Required sender full name (address can be skipped):
from: Luke Skywalker # <user@example.com>
# Optional whether this connection use TLS (default is true if server_port is 465)
secure: true
# Optional plain body:
body: Build job of ${{github.repository}} completed successfully!
# Optional HTML body read from file:
html_body: file://README.html
# Optional carbon copy recipients:
cc: kyloren@example.com,leia@example.com
# Optional blind carbon copy recipients:
bcc: r2d2@example.com,hansolo@example.com
# Optional recipient of the email response:
reply_to: luke@example.com
# Optional Message ID this message is replying to:
in_reply_to: <random-luke@example.com>
# Optional unsigned/invalid certificates allowance:
ignore_cert: true
# Optional converting Markdown to HTML (set content_type to text/html too):
convert_markdown: true
# Optional attachments:
attachments: attachments.zip,git.diff,./dist/static/*.js
# Optional priority: 'high', 'normal' (default) or 'low'
priority: lowConfiguration
The following settings must be passed as environment variables as shown in the example. Sensitive information, especially AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY, should be set as encrypted secrets — otherwise, they'll be public to anyone browsing your repository's source code and CI logs.
| Key | Value | Suggested Type | Required | Default |
|---|---|---|---|---|
report_url |
Your Report URL. | argument |
Yes | none |
test_results |
results-history | argument |
No | test-results |
results_history |
results-history | argument |
No | results-history |
keep_reports |
20 | argument |
No | 20 |
AWS_ACCESS_KEY_ID |
Your AWS Access Key. More info here. | secret env |
Yes | N/A |
AWS_SECRET_ACCESS_KEY |
Your AWS Secret Access Key. More info here. | secret env |
Yes | N/A |
AWS_S3_BUCKET |
The name of the bucket you're syncing to. For example, jarv.is or my-app-releases. |
secret env |
Yes | N/A |
AWS_REGION |
The region where you created your bucket. Set to us-east-1 by default. Full list of regions here. |
env |
No | us-east-1 |
AWS_S3_ENDPOINT |
The endpoint URL of the bucket you're syncing to. Can be used for VPC scenarios or for non-AWS services using the S3 API, like DigitalOcean Spaces. | env |
No | Automatic (s3.amazonaws.com or AWS's region-specific equivalent) |
SOURCE_DIR |
The local directory (or file) you wish to sync/upload to S3. For example, public. Defaults to your entire repository. |
env |
No | ./ (root of cloned repository) |
DEST_DIR |
The directory inside of the S3 bucket you wish to sync/upload to. For example, my_project/assets. Defaults to the root of the bucket. |
env |
No | / (root of bucket) |
AWS S3 Bucket folder structure sample:- Organized by Github Run Number
Note:- Always the index.html points to Test Results History Page.





