Skip to content

Commit

Permalink
fix: add build step and use yarn for wrangler
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Nov 29, 2023
1 parent ac3e06a commit f99b69f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/cloudflare-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,11 @@ jobs:
- name: Yarn Install
run: yarn install

- name: Build the project
run: yarn build

- name: Wrangler Install
run: npm install -g wrangler
run: yarn add wrangler

- name: Publish to Cloudflare
env:
Expand All @@ -38,11 +41,11 @@ jobs:
IFS='/' read -ra fields <<< "$REPOSITORY"
projectName="${fields[1]}"
echo $projectName
wrangler pages project list > project_list.txt
yarn wrangler pages project list > project_list.txt
if grep -q $projectName project_list.txt; then
echo "Project found"
else
echo "Project not found"
wrangler pages project create "$projectName" --production-branch "$PRODUCTION_BRANCH"
yarn wrangler pages project create "$projectName" --production-branch "$PRODUCTION_BRANCH"
fi
wrangler pages publish "$OUTPUT_DIRECTORY" --project-name "$projectName"
yarn wrangler pages publish "$OUTPUT_DIRECTORY" --project-name "$projectName"

0 comments on commit f99b69f

Please sign in to comment.