-
Notifications
You must be signed in to change notification settings - Fork 25
38 lines (36 loc) · 1.33 KB
/
cloudflare-deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Deploy to Cloudflare Pages
on:
workflow_run:
workflows: ["Build"] # Needs to build first before we can deploy.
types:
- completed
jobs:
deploy-to-cloudflare:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Check Cloudflare API Token
id: check_token
run: |
if [[ -z "${{ secrets.CLOUDFLARE_API_TOKEN }}" ]]; then
echo "Cloudflare API token is not set. Skipping deployment."
echo "::set-output name=skip::true"
else
echo "::set-output name=skip::false"
fi
shell: bash
- name: Deploy to Cloudflare
if: steps.check_token.outputs.skip != 'true'
uses: ubiquity/cloudflare-deploy-action@main
with:
cloudflare_api_token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
repository: ${{ github.repository }}
production_branch: ${{ github.event.repository.default_branch }}
output_directory: "dist"
is_production: ${{ github.event_name == 'push' && github.ref == 'refs/heads/${{ github.event.repository.default_branch }}' }}
# env:
# Add any environment variables you need to pass along here
# SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}