Skip to content

Deploy Example Site #43

Deploy Example Site

Deploy Example Site #43

name: Deploy Example Site
on:
workflow_dispatch:
workflow_run:
workflows: ["Increment & Publish"]
branches: [main]
types:
- completed
defaults:
run:
working-directory: example/react-tableau-embed-live-examples
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 16
- name: Test directory and node
run: |
node -v
pwd
- name: Install dependencies
run: npm ci
- name: Update library
run: npm update @stoddabr/react-tableau-embed-live
- name: Check library version
run: npm list @stoddabr/react-tableau-embed-live
- name: Build project
run: npm run build
- name: Upload production-ready build files
uses: actions/upload-artifact@v2
with:
name: example-production-files
path: ./example/react-tableau-embed-live-examples/dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/main'
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: example-production-files
path: ./example/react-tableau-embed-live-examples/dist
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./example/react-tableau-embed-live-examples/dist