Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: pull request and main preview deployment with cloudflare pages #52

Merged
merged 1 commit into from
Jan 17, 2025

Conversation

gabrielpenteado
Copy link
Contributor

  • PR and main preview deployment to CloudFlare Pages adding the deployment link as a comment to the respective PR.
  • After the merge is approved, the main branch is deployed to production.

Requirements:

  1. Create a CloudFlare API Token:
    Access the profile; go to API Tokens; create a custom token with the following permissions: (account - Cloudflare Pages - edit) and (zone - clean cache - clean).

  2. Add Cloudflare API_TOKEN and ACCOUNT_ID as secrets in the base GitHub repository.

  3. Create a project on Cloudflare Pages. The name given to the project in CloudFlare Pages must be the same used in the deploy action script pages deploy dist --project-name=<CloudFlare_Pages_Project_Name>

  4. The file wrangler.toml is used for manual deployments if necessary; it also needs the name of the project in CloudFlare Pages.

Copy link
Owner

@alcpereira alcpereira left a comment

Choose a reason for hiding this comment

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

Good job, some minor changes are required.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
wrangler.toml Outdated Show resolved Hide resolved
@alcpereira alcpereira merged commit 7157c9a into alcpereira:main Jan 17, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants