Skip to content

Commit

Permalink
chore: debug cd
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Feb 19, 2024
1 parent de20331 commit ea72c5e
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 38 deletions.
43 changes: 42 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,45 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: preserved
path: preserved

# name: Deploy to Cloudflare Pages

# on:
# workflow_dispatch:
# 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"
current_branch: ${{ github.ref_name }}
# env:
# Add any environment variables you need to pass along here
# SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
74 changes: 37 additions & 37 deletions .github/workflows/cloudflare-deploy.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
name: Deploy to Cloudflare Pages
# name: Deploy to Cloudflare Pages

on:
workflow_dispatch:
workflow_run:
workflows: ["Build"] # Needs to build first before we can deploy.
types:
- completed
# on:
# workflow_dispatch:
# # 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
# 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"
current_branch: ${{ github.ref_name }}
# env:
# Add any environment variables you need to pass along here
# SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
# - 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"
# current_branch: ${{ github.ref_name }}
# # env:
# # Add any environment variables you need to pass along here
# # SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
# # SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}

0 comments on commit ea72c5e

Please sign in to comment.