Merge pull request #11 from Adnan-The-Coder/feat/dashboard #38
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: Automated Web App Deployment to Cloudflare Workers | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'apps/web/**' | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - 'apps/web/**' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: apps/web # run everything inside apps/web | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: latest | |
| run_install: false | |
| - name: Get pnpm store directory | |
| shell: bash | |
| run: | | |
| echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
| - name: Setup pnpm cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${{ env.STORE_PATH }} | |
| key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pnpm-store- | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Build OpenNext output | |
| run: pnpm exec opennextjs-cloudflare build | |
| working-directory: apps/web | |
| # Deploy using your package.json "deploy" script | |
| - name: Deploy to Cloudflare Workers | |
| run: pnpm run deploy | |
| env: | |
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} |