Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show preview URL to as a PR message #31

Open
oriolpuig opened this issue May 16, 2020 · 1 comment
Open

Show preview URL to as a PR message #31

oriolpuig opened this issue May 16, 2020 · 1 comment

Comments

@oriolpuig
Copy link

Hi,

First of all, congrats to all of contributors, because following your docs, I could setup a Github Action to deploy my application while PR is created or any push to master has done very easy. I guess it takes me no more than 1h!

Sorry if exist that documentation but, could be possible to add a new message at the PR adding the preview URL? I saw Now.sh or Vercel do that.

Thanks in advance!

@calitb
Copy link

calitb commented Jul 22, 2020

hi there @oriolpuig I was just playing with this action. In case you still are wondering how to do it.

Just make sure to use an id in your deployment step and then you can access the preview and live url.

      - name: Deploy to Netlify
        id: deploy-neflify
        uses: netlify/actions/cli@master
        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
        with:
          args: deploy --dir=dist

      - name: Netlify Preview URL
        uses: unsplash/comment-on-pr@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          OUTPUT: "This pull request is being automatically deployed to Netlify.\n\n🔍 Inspect: ${{ steps.deploy-neflify.outputs.NETLIFY_LOGS_URL }}\n✅ Preview: ${{ steps.deploy-neflify.outputs.NETLIFY_URL }}"
        with:
          msg: ${{ env.OUTPUT }}
          check_for_duplicate_msg: false

this is my full workflow https://github.com/calitb/VueJS-Sample/blob/master/.github/workflows/deploy_staging.yml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants