From 6c31421b268466362f6ffcdc0d84c66661ba9baa Mon Sep 17 00:00:00 2001 From: Marc Cataford Date: Mon, 18 Mar 2024 21:13:41 -0400 Subject: [PATCH] feat: deploy to CF pages --- .github/workflows/main.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0789a27..4a5d768 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,6 @@ on: push: branches: main - pull_request: env: NODE_VERSION: 20 @@ -93,6 +92,30 @@ jobs: with: name: build-artifacts path: dist + deploy-frontend: + runs-on: ubuntu-latest + name: Deploy frontend + needs: build-app + steps: + - uses: actions/checkout@v4 + - name: Yarn cache + uses: actions/cache@v4 + id: yarn-cache-restore + with: + path: | + .yarn + key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}-${{ env.NODE_VERSION }} + - run: corepack enable + - name: Build Artifacts + uses: actions/download-artifact@v4 + with: + name: build-artifacts + path: dist + - uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy --project-name=rss-reader ./dist deploy-functions: runs-on: ubuntu-latest name: Deploy functions