feat: initial version for preview environments action #8
Workflow file for this run
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: Preview Environment | |
| on: | |
| pull_request: | |
| types: [opened, reopened, synchronize, closed] | |
| permissions: | |
| deployments: write # allow creating deployments | |
| pull-requests: write # allow commenting on PRs | |
| contents: read # minimal read access to repo, if needed | |
| env: | |
| NODE_VERSION: 20 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| name: Build | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.12.2 | |
| run_install: false | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm i | |
| - name: Build examples | |
| env: | |
| ZE_SECRET_TOKEN: ${{ secrets.ZE_SECRET_TOKEN }} | |
| ZE_API: ${{ vars.ZE_API }} | |
| ZE_API_GATE: ${{ vars.ZE_API_GATE }} | |
| run: pnpm run build:examples | |
| - name: Deploy preview environment | |
| uses: ./ | |
| id: preview_environment_action | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Preview deployment URL | |
| if: steps.preview_environment_action.outputs.preview_environment_url | |
| run: echo "Preview available at ${{ steps.preview_environment_action.outputs.preview_environment_url }}" |