diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index efecac5..5530899 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,7 @@ -on: [push] +on: + push: + pull_request_target: + types: [opened, synchronize, reopened] jobs: deploy: @@ -7,12 +10,15 @@ jobs: permissions: contents: read deployments: write + pull-requests: write name: Deploy to Cloudflare Pages steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha || github.sha }} - name: Setup Ruby uses: ruby/setup-ruby@v1 @@ -25,11 +31,27 @@ jobs: 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 - gitHubToken: ${{ secrets.GITHUB_TOKEN }} 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 }} diff --git a/Gemfile b/Gemfile index 8d1d05e..67ff1cd 100644 --- a/Gemfile +++ b/Gemfile @@ -32,3 +32,4 @@ gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby] gem "webrick", "~> 1.8" + diff --git a/Gemfile.lock b/Gemfile.lock index d8d46e6..f01204c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,7 +9,9 @@ GEM eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) - ffi (1.16.3) + ffi (1.17.4-arm64-darwin) + ffi (1.17.4-x86_64-darwin) + ffi (1.17.4-x86_64-linux-gnu) forwardable-extended (2.6.0) google-protobuf (4.26.1-arm64-darwin) rake (>= 13) @@ -83,6 +85,7 @@ GEM PLATFORMS arm64-darwin-22 arm64-darwin-23 + arm64-darwin-24 x86_64-darwin-21 x86_64-linux diff --git a/_includes/meetups.html b/_includes/meetups.html index 19e3446..96b2386 100644 --- a/_includes/meetups.html +++ b/_includes/meetups.html @@ -4,6 +4,7 @@

EDICIONES PASADAS

Conocé el contenido de las ediciones pasadas.

+ {% assign months_es = "ENE,FEB,MAR,ABR,MAY,JUN,JUL,AGO,SEP,OCT,NOV,DIC" | split: ',' %} {% assign meetups_sorted = site.meetups | sort: "date" | reverse %} {% assign meetups_by_year = meetups_sorted @@ -12,14 +13,14 @@

EDICIONES PASADAS

| reverse %} {% for year in meetups_by_year | reverse %} -

{{ year.name }}

+

{{ year.name }}