Deploy Preview #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy Preview | |
on: | |
workflow_run: | |
workflows: | |
- Build and Preview Site | |
types: | |
- completed | |
jobs: | |
deploy-preview: | |
if: github.repository == 'meshery/meshery' | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: Download Site dir | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
github_token: ${{ secrets.GH_ACCESS_TOKEN }} | |
workflow: build-and-preview-site.yml | |
run_id: ${{ github.event.workflow_run.id }} | |
name: site-dir | |
- name: Unzip Site | |
run: | | |
rm -rf ./docs/_site | |
unzip site-dir.zip | |
rm -f site-dir.zip | |
- name: Deploy to Netlify | |
id: netlify | |
uses: nwtgck/[email protected] | |
with: | |
publish-dir: 'docs/_site' | |
production-deploy: false | |
github-token: ${{ secrets.GH_ACCESS_TOKEN }} | |
enable-commit-comment: false | |
env: | |
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
- name: Comment Deploy URL | |
uses: ./.github/actions/comment-preview-on-pr | |
with: | |
token: ${{ secrets.GH_ACCESS_TOKEN }} | |
deploy_url: "${{ steps.netlify.outputs.deploy-url }}" | |