Skip to content

Commit

Permalink
ci: add deploy step
Browse files Browse the repository at this point in the history
  • Loading branch information
robingenz committed Nov 9, 2024
1 parent 441e965 commit 21803f1
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,32 @@ jobs:
run: npm ci
- name: Run unit tests
run: npm run test:ci
deploy:
name: Deploy to Cloudflare Pages
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: www
path: www
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
id: cloudflare-deployment
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: www
- name: Comment the preview url
if: github.event_name == 'pull_request'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.number }}
body: |
Deploy preview available at: ${{ steps.cloudflare-deployment.outputs.url }}
Built with commit ${{ github.event.pull_request.head.sha }}.

0 comments on commit 21803f1

Please sign in to comment.