Skip to content

Merge pull request #144 from AFornio/community-stats #314

Merge pull request #144 from AFornio/community-stats

Merge pull request #144 from AFornio/community-stats #314

Workflow file for this run

on:
push:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
pull-requests: write
name: Deploy to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Build the website
run: bundle exec jekyll build
env:
JEKYLL_ENV: production
- name: Publish
id: cloudflare
uses: cloudflare/pages-action@v1.5.0
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ruby-uy
directory: _site
wranglerVersion: '3'
branch: ${{ github.event.pull_request.head.ref || github.ref_name }}
- name: Comment preview URL on PR
if: github.event_name == 'pull_request_target'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `🔍 Preview: ${process.env.DEPLOY_URL}`
})
env:
DEPLOY_URL: ${{ steps.cloudflare.outputs.url }}