1

I am using s3 bucket, to deploy my html website. Now I have created a github action that will deploy to s3 buckeet when pushed to main.

Now I have created a develop branch and want to merge my changes to master using Pull Request, I have written another github action to sync to s3 bucket when a PR is created on master to view the changes before merging it.

I am able to create a PR and the github action is also triggered, and the s3 bucket is getting synced and website is deployed, thing is I want the link of the website to be in the PR as well.

I am unable to figure that out. Is it possible to display the link to the website when the action is completed?

PR Request

My Actions workfile:

name: Website Pull Request

on:
  pull_request:
    branches:
      - master

jobs:
  static:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: S3 Syncing
      uses: jakejarvis/s3-sync-action@master
      with:
        args: --follow-symlinks --delete --exclude '.git*/*'
      env:
        AWS_S3_BUCKET: ${{ secrets.AWS_TEST_S3_BUCKET }}
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_TEST_ACCESS_KEY }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_TEST_ACCESS_SECRET }}
        AWS_REGION: 'ap-south-1'
4

1 回答 1

1

If you know the website link upfront (or you are able to retrieve it in some automated way) then you can add it as a PR comment after deploying the website to S3. You can use a dedicated GitHub Action to add a customized PR comment with a link to the deployed website. There are plenty of them on GitHub Marketplace.

于 2020-11-02T12:37:17.667 回答