This is an automated email from the ASF dual-hosted git repository.

zregvart pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-website.git

commit 84c229d9d0bc028478490365ac192334b1866558
Author: Zoran Regvart <[email protected]>
AuthorDate: Sun Dec 27 22:22:27 2020 +0100

    chore: previews with github-script and netlify-cli
    
    Reworks the previews using github-script action and netlify-cli.
---
 .github/workflows/pr.yaml | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml
index c825be5..8a50d3e 100644
--- a/.github/workflows/pr.yaml
+++ b/.github/workflows/pr.yaml
@@ -49,17 +49,22 @@ jobs:
           name: website
           path: public
       - name: Preview on Netlify
-        uses: nwtgck/[email protected]
-        with:
-          publish-dir: 'public'
-          github-token: ${{ secrets.GITHUB_TOKEN }}
-          deploy-message: ${{ github.event.number }} ${{ 
github.event.pull_request.title }}
-          alias: preview-${{ github.event.number }}
-          github-deployment-environment: preview
-          enable-commit-comment: false
+        run: |
+          DEPLOY_URL=$(yarn preview:netlify --alias="${GITHUB_SHA}" 
--message="Preview for ${GITHUB_SHA}" --json 2> /dev/null |jq .deploy_url)
+          echo "::set-output name=DEPLOY_URL::${DEPLOY_URL}"
         env:
           NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
           NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
+      - uses: actions/github-script@v3
+        with:
+          github-token: ${{ secrets.GITHUB_TOKEN }}
+          script: |
+            github.issues.createComment({
+              issue_number: context.issue.number,
+              owner: context.repo.owner,
+              repo: context.repo.repo,
+              body: `🚀 Preview is available at ${core.getInput('DEPLOY_URL')}`
+            })
   checks:
     needs: build
     runs-on: ubuntu-latest

Reply via email to