fix(workflow): only run cleanup on closed with in preview env #3
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: Deployment (Production) | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - ci/split-workflow-into-multiple-files | |
| concurrency: | |
| group: deployment-production-${{ github.ref }} | |
| cancel-in-progress: false | |
| env: | |
| NODE_VERSION: '24.11.1' | |
| PNPM_VERSION: '10.23.0' | |
| STAGE: 'production' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: production | |
| permissions: | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: ${{ env.PNPM_VERSION }} | |
| run_install: false | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install | |
| - name: Build and deploy | |
| run: pnpm alchemy deploy --stage ${{ env.STAGE }} | |
| env: | |
| # Alchemy | |
| HOSTNAME: ${{ vars.HOSTNAME }} | |
| ALCHEMY_SECRET: ${{ secrets.ALCHEMY_SECRET }} | |
| ALCHEMY_STATE_TOKEN: ${{ secrets.ALCHEMY_STATE_TOKEN }} | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }} | |
| # Build | |
| VITE_PUBLIC_POSTHOG_HOST: ${{ vars.VITE_PUBLIC_POSTHOG_HOST }} | |
| VITE_PUBLIC_POSTHOG_KEY: ${{ secrets.VITE_PUBLIC_POSTHOG_KEY }} | |
| VITE_PUBLIC_POSTHOG_DEBUG: ${{ vars.VITE_PUBLIC_POSTHOG_DEBUG }} | |
| VITE_PUBLIC_POSTHOG_ENABLED: ${{ vars.VITE_PUBLIC_POSTHOG_ENABLED }} | |
| # Sourcemap inject and upload | |
| POSTHOG_CLI_HOST: ${{ vars.POSTHOG_CLI_HOST }} | |
| POSTHOG_CLI_ENV_ID: ${{ secrets.POSTHOG_CLI_ENV_ID }} | |
| POSTHOG_CLI_TOKEN: ${{ secrets.POSTHOG_CLI_TOKEN }} |