Skip to content

Commit

Permalink
Merge pull request #3 from ubiquity/ci/read-cf-creds-from-input
Browse files Browse the repository at this point in the history
ci: read cloudflare credentials from action input
  • Loading branch information
0x4007 authored Mar 13, 2024
2 parents 06783ab + f893c79 commit 5f7a489
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/cloudflare-deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ echo "Checking if project exists..."

# Specifically scoped for public contributors to automatically deploy to our team Cloudflare account

CLOUDFLARE_ACCOUNT_ID="17b9dfa79e16b79dffcb11a66768539c"

# Fetch the list of projects and check if the specific project exists
project_exists=$(curl -s -X GET "https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/pages/projects" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
Expand Down
9 changes: 8 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ inputs:
pull_request_number:
description: "Pull request number for posting the deployment link"
required: true
cloudflare_account_id:
description: "Cloudflare account id"
required: true
cloudflare_api_token:
description: "Cloudflare API token"
required: true
commit_sha:
description: "Commit SHA for posting the deployment link"
required: false
Expand All @@ -39,7 +45,8 @@ runs:
run: bash ../../_actions/ubiquity/cloudflare-deploy-action/main/.github/cloudflare-deploy.sh "${{ inputs.repository }}" "${{ inputs.production_branch }}" "${{ inputs.output_directory }}" "${{ inputs.current_branch }}"
shell: bash
env:
CLOUDFLARE_API_TOKEN: "JWo5dPsoyohH5PRu89-RktjCvRN0-ODC6CC9ZBqF"
CLOUDFLARE_ACCOUNT_ID: ${{ inputs.cloudflare_account_id }}
CLOUDFLARE_API_TOKEN: ${{ inputs.cloudflare_api_token }}

- name: Post Deployment on Pull Request or Commit
shell: bash
Expand Down

0 comments on commit 5f7a489

Please sign in to comment.