Skip to content

Add Voice Outbound Node #59

Add Voice Outbound Node

Add Voice Outbound Node #59

Workflow file for this run

name: Preview Tutorial
on:
pull_request:
branches: ["main"]
types:
- labeled
- synchronize
jobs:
deploy-preview:
if: contains(github.event.pull_request.labels.*.name, 'Preview')
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get changed files
id: get-changed-files
uses: tj-actions/changed-files@v45
- name: Get changed folder
id: get-changed-folder
env:
ALL_CHANGED_FILES: ${{ steps.get-changed-files.outputs.all_changed_files }}
run: |
first_file=$(echo "$ALL_CHANGED_FILES" | tr ' ' '\n' | grep "^tutorials/" | grep -v "^tutorials/00" | head -n 1)
top_level_dir=$(echo "$first_file" | cut -d'/' -f1,2)
echo "dir=$top_level_dir" >> "$GITHUB_OUTPUT"
- name: Check for config file
working-directory: ${{ steps.get-changed-folder.outputs.dir }}
run: |
pwd
if [ ! -f tutorial-config.json ]; then
echo "tutorial-config.json not found. Exiting."
exit 1
fi
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 22.4
- name: Install dependencies
working-directory: ${{ github.workspace }}/tutorials
run: |
node -v
npm -v
npm install
- name: Run build
working-directory: ${{ steps.get-changed-folder.outputs.dir }}
run: |
npm run build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: "${{ steps.get-changed-folder.outputs.dir }}/dist"
publish_branch: gh_pages
destination_dir: "${{ steps.get-changed-folder.outputs.dir }}/preview"
- name: Leave comment on PR
uses: actions/github-script@v7
with:
script: |
await github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Your Tutorial Preview has been deployed: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/${{ steps.get-changed-folder.outputs.dir }}/preview/'
});