Skip to content

Commit e89f7de

Browse files
author
Ernesto Castellotti
authored
Added the autogeneration of the site preview in the PR (#223)
1 parent 8fe62ca commit e89f7de

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

.github/workflows/preview-pr.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: preview-pr
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, reopened]
6+
7+
permissions:
8+
pull-requests: write
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Setup Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: '3.0'
20+
bundler-cache: true
21+
- run: bundle exec jekyll build --baseurl ""
22+
- name: Publish to Cloudflare Pages
23+
id: preview-pages
24+
uses: cloudflare/pages-action@v1
25+
with:
26+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
27+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT }}
28+
projectName: hack-gpon-preview
29+
directory: _site
30+
branch: preview
31+
- uses: thollander/actions-comment-pull-request@v2
32+
with:
33+
message: |
34+
Preview of the website obtained from the PR: ${{ steps.preview-pages.outputs.url }}
35+

0 commit comments

Comments
 (0)