File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,28 @@ jobs:
22
22
timeout-minutes : 10
23
23
environment :
24
24
name : preview
25
- url : https://font-generator-preview.pages.dev/
25
+ url : ${{ steps.deployment.outputs.page_url }}
26
26
steps :
27
27
- uses : actions/checkout@v4
28
28
- name : Install dependencies
29
29
run : npm install
30
30
- name : Deploy to Cloudflare Pages
31
31
run : |
32
- response=$(curl -s -o /dev/null -w "%{http_code}" -X GET "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/font-generator-preview " \
32
+ response=$(curl -s -o /dev/null -w "%{http_code}" -X GET "https://api.cloudflare.com/client/v4/accounts/${{ secrets.CLOUDFLARE_ACCOUNT_ID }}/pages/projects/font-generator" \
33
33
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_API_TOKEN }}")
34
34
if [ $response -eq 404 ]; then
35
35
echo "Project does not exist, creating..."
36
- npx wrangler pages project create font-generator-preview --production-branch main
36
+ npx wrangler pages project create font-generator --production-branch main
37
37
else
38
38
echo "Project exists, skipping creation."
39
- fi
40
- sed -i 's/font-generator/font-generator-preview/' wrangler.toml
41
- npm run pages:build && npx wrangler pages deploy --branch main
39
+ fi
42
40
env :
43
41
CLOUDFLARE_API_TOKEN : ${{ secrets.CLOUDFLARE_API_TOKEN }}
44
42
CLOUDFLARE_ACCOUNT_ID : ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
43
+
44
+ - name : Deploy to Cloudflare Pages
45
+ uses : actions/deploy-pages@v4
46
+ with :
47
+ token : ${{ secrets.CLOUDFLARE_API_TOKEN }}
48
+ preview : true
49
+
You can’t perform that action at this time.
0 commit comments