From 6fafa35a78459c221b2a8c87331bfcceeda8dc57 Mon Sep 17 00:00:00 2001 From: Sasi Date: Sat, 4 Feb 2023 15:44:51 +0530 Subject: [PATCH] temp: cf action (#572) * chore: add deploy action * fix: typo * fix: typo --- .github/workflows/cd.yml | 32 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 3 ++- .nvmrc | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cd.yml create mode 100644 .nvmrc diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 000000000..c4aa8c178 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,32 @@ +name: Export and Deploy + +on: + workflow_run: + branches: [main] + workflows: [CI] + types: + - completed + +jobs: + checkout: + uses: lenstube-xyz/lenstube/.github/workflows/ci.yml@main + deploy: + timeout-minutes: 15 + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + + + steps: + - name: Build and Export 📦 + run: npx turbo run export + + - name: Publish to Cloudflare Pages 🚀 + uses: cloudflare/pages-action@1 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + projectName: lenstube-web + directory: apps/web/out + gitHubToken: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 82f75dfff..df337bbe6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: [main] pull_request: types: [opened, synchronize] + workflow_call: jobs: build: @@ -21,7 +22,7 @@ jobs: - name: Setup Node.js environment 📐 uses: actions/setup-node@v3 with: - node-version: 16 + node-version-file: '.nvmrc' cache: 'yarn' - name: Install dependencies 🧳 diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..3c032078a --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +18