Skip to content

Commit

Permalink
enable doc preview job
Browse files Browse the repository at this point in the history
  • Loading branch information
mtulio committed Oct 23, 2023
1 parent 0202c40 commit 47f3db4
Showing 1 changed file with 55 additions and 55 deletions.
110 changes: 55 additions & 55 deletions .github/workflows/site-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,70 +15,70 @@ jobs:
steps:
- uses: actions/checkout@v2

# - name: Set job vars
# id: vars
# run: |
# echo "cache-key-npm=npm-vercel-${VERCEL_VERSION}" >> $GITHUB_OUTPUT
# echo "cache-dir-npm=${HOME}/.npm" >> $GITHUB_OUTPUT
- name: Set job vars
id: vars
run: |
echo "cache-key-npm=npm-vercel-${VERCEL_VERSION}" >> $GITHUB_OUTPUT
echo "cache-dir-npm=${HOME}/.npm" >> $GITHUB_OUTPUT
# - name: Set npm cache
# uses: actions/cache@v3
# with:
# path: ${{ steps.vars.outputs.cache-dir-npm }}
# key: ${{ steps.vars.outputs.cache-key-npm }}
- name: Set npm cache
uses: actions/cache@v3
with:
path: ${{ steps.vars.outputs.cache-dir-npm }}
key: ${{ steps.vars.outputs.cache-key-npm }}

- name: Install Vercel CLI
run: npm install --global vercel@${VERCEL_VERSION}

# - name: Install Vercel CLI
# run: npm install --global vercel@${VERCEL_VERSION}
- name: Pull Vercel Environment Information
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}

# - name: Pull Vercel Environment Information
# run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}

# - name: Build Project Artifacts
# run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
id: verceldeploy
run: |
export PREVIEW_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | tee out.log)
export PREVIEW_URL=$(grep ^Preview out.log | awk '{print$2}')
echo "Discovered Preview URL: ${PREVIEW_URL}"
echo "url=$PREVIEW_URL" >> $GITHUB_OUTPUT
# - name: Deploy Project Artifacts to Vercel
# id: verceldeploy
# run: |
# export PREVIEW_URL=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | tee out.log
# export PREVIEW_URL=$(grep ^Preview out.log | awk '{print$2}')
# echo "Discovered Preview URL: ${PREVIEW_URL}"
# echo "url=$PREVIEW_URL" >> $GITHUB_OUTPUT
# - name: Update PR with test results
# uses: edumserrano/find-create-or-update-comment@v1
# with:
# issue-number: ${{ github.event.pull_request.number }}
# body-includes: '<!-- pr-test-results -->'
# comment-author: 'github-actions[bot]'
# body: | # can be a single value or you can compose text with multi-line values
# <!-- pr-test-results -->
# Preview Documentation published at URL: ${{ steps.verceldeploy.outputs.url }}
# edit-mode: replace

# # - name: Update PR with test results
# # uses: edumserrano/find-create-or-update-comment@v1
# # with:
# # issue-number: ${{ github.event.pull_request.number }}
# # body-includes: '<!-- pr-test-results -->'
# # comment-author: 'github-actions[bot]'
# # body: | # can be a single value or you can compose text with multi-line values
# # <!-- pr-test-results -->
# # Preview Documentation published at URL: ${{ steps.verceldeploy.outputs.url }}
# # edit-mode: replace
# - name: Find comment
# uses: peter-evans/find-comment@v2
# id: fbc
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-author: 'github-actions[bot]'
# body-includes: Docs published!

# # - name: Find comment
# # uses: peter-evans/find-comment@v2
# # id: fbc
# # with:
# # issue-number: ${{ github.event.pull_request.number }}
# # comment-author: 'github-actions[bot]'
# # body-includes: Docs published!
- name: Create comment
# if: steps.fbc.outputs.comment-id == ''
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Docs published!
- Preview URL: ${{ steps.verceldeploy.outputs.url-dev }}
reactions: rocket

# - name: Create comment
# # if: steps.fbc.outputs.comment-id == ''
# - name: Update comment
# if: steps.fbc.outputs.comment-id != ''
# uses: peter-evans/create-or-update-comment@v3
# with:
# issue-number: ${{ github.event.pull_request.number }}
# comment-id: ${{ steps.fbc.outputs.comment-id }}
# body: |
# Docs published!
# - Preview URL: ${{ steps.verceldeploy.outputs.url-dev }}
# reactions: rocket

# # - name: Update comment
# # if: steps.fbc.outputs.comment-id != ''
# # uses: peter-evans/create-or-update-comment@v3
# # with:
# # comment-id: ${{ steps.fbc.outputs.comment-id }}
# # body: |
# # Docs published!
# # - Preview URL: ${{ steps.deploy.outputs.url-dev }}
# # reactions: hooray
# - Preview URL: ${{ steps.deploy.outputs.url-dev }}
# reactions: hooray

0 comments on commit 47f3db4

Please sign in to comment.