fix: local dev cannot proxy online and update dev docs (#1744) #73
This file contains hidden or 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 to GitHub Pages | |
| on: | |
| push: | |
| branches: [develop] | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'Backend environment' | |
| required: true | |
| default: 'alpha' | |
| type: choice | |
| options: | |
| - alpha | |
| - production | |
| jobs: | |
| deploy-gh-pages: | |
| runs-on: ubuntu-latest | |
| concurrency: | |
| group: deploy-gh-pages | |
| cancel-in-progress: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10 | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: add environment variable | |
| run: | | |
| ENV=${{ github.event.inputs.environment || 'alpha' }} | |
| VITE_ORIGIN_URL="https://agent-alpha.opentiny.design/" | |
| if [ "$ENV" = "production" ]; then | |
| VITE_ORIGIN_URL="https://agent.opentiny.design/" | |
| fi | |
| cat <<EOF >> designer-demo/env/.env.alpha | |
| # ---- appended by CI (gh-pages) ---- | |
| VITE_ORIGIN=$VITE_ORIGIN_URL | |
| EOF | |
| echo "DEPLOY_ENV=$ENV" | |
| echo "VITE_ORIGIN_URL=$VITE_ORIGIN_URL" | |
| - name: Run Build | |
| run: | | |
| set -eo pipefail | |
| pnpm run build:plugin 2>&1 | tee /tmp/build-plugin.log | |
| pnpm run build:alpha 2>&1 | tee /tmp/build-alpha.log | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./designer-demo/dist/ | |
| keep_files: true | |
| force_orphan: false | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' |