Skip to content

Commit

Permalink
ci: pull request and main preview deployment with cloudflare pages
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielpenteado authored and alcpereira committed Jan 17, 2025
1 parent 6dc9916 commit 7157c9a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,35 @@ jobs:

- name: Run typecheck
run: npm run typecheck

build_deploy:
runs-on: ubuntu-latest
needs: typecheck
permissions:
contents: read
deployments: write
pull-requests: write

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Install dependencies
run: npm install

- name: Build frontend
run: npm run build

- name: Deploy to Cloudflare Pages
id: deploy
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
command: pages deploy ./dist --project-name=cv-generator --branch=${{ github.ref_name }}

0 comments on commit 7157c9a

Please sign in to comment.