Skip to content

Commit

Permalink
feat: cd
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 committed Feb 19, 2024
2 parents b30272d + 059487c commit 9fbac16
Showing 1 changed file with 42 additions and 39 deletions.
81 changes: 42 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,46 +10,49 @@ jobs:
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.10.0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20.10.0

- name: Build
run: |
yarn
yarn build
- name: Build
run: |
yarn
yarn build
- 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: 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 }}
pull_request_number: ${{ github.event.pull_request.number }}
commit_sha: ${{ github.sha }}

env:
TEST_TEMPLATE: ${{ secrets.TEST_TEMPLATE }}
TEST_CLOUDFLARE_DEPLOY: ${{ secrets.TEST_CLOUDFLARE_DEPLOY }}
# 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 }}
pull_request_number: ${{ github.event.pull_request.number }}
commit_sha: ${{ github.sha }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
app_id: ${{ secrets.APP_ID }}
app_installation_id: ${{ secrets.APP_INSTALLATION_ID }}
# other inputs...
# env:
# TEST_TEMPLATE: ${{ secrets.TEST_TEMPLATE }}
# TEST_CLOUDFLARE_DEPLOY: ${{ secrets.TEST_CLOUDFLARE_DEPLOY }}
# env:
# Add any environment variables you need to pass along here
# SUPABASE_URL: ${{ secrets.SUPABASE_URL }}
# SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}

1 comment on commit 9fbac16

@ubiquibot
Copy link

@ubiquibot ubiquibot bot commented on 9fbac16 Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.