chore: update deploy script #2
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 widget test app to GitHub Pages | |
on: | |
push: | |
branches: | |
- main # Deploy when changes are pushed to the main branch | |
paths: | |
- 'packages/widget-test-app/**' # Trigger only for changes in the widget test app directory | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18.18.2' | |
- name: Install dependencies | |
run: yarn install | |
- name: Set environment variables # Add environment variables here | |
run: | | |
echo "VITE_D3_API_KEY=${{ secrets.VITE_D3_API_KEY }}" >> packages/widget-test-app/.env | |
echo "VITE_TLDS=shib,core" >> packages/widget-test-app/.env | |
echo "VITE_API_ENDPOINT=https://api-public-dev.d3.app" >> packages/widget-test-app/.env | |
- name: Build the widget test app for production | |
run: yarn build:app | |
- name: Deploy to GitHub Pages | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
publish_dir: packages/widget-test-app/dist |