-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6819c03
commit fbcd28c
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: 'Build Pull Request' | ||
run-name: Build and upload preview for PR ${{ github.event.pull_request.number }} | ||
|
||
on: | ||
pull_request: | ||
types: [synchronize, opened] | ||
|
||
jobs: | ||
build: | ||
name: Build and upload site | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup hugo | ||
uses: peaceiris/actions-hugo@v2 | ||
with: | ||
hugo-version: "0.119.0" | ||
|
||
- name: Build | ||
run: hugo | ||
|
||
- uses: matyrobbrt/cloudflare-pr-previews/upload@v1 | ||
name: Upload website | ||
with: | ||
build-dir: ./public/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: 'Pull Request Previews' | ||
run-name: Upload previews from workflow run ${{ github.event.workflow_run.id }} | ||
on: | ||
workflow_run: | ||
workflows: [Build Pull Request] | ||
types: | ||
- completed | ||
|
||
concurrency: | ||
group: preview-pr | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
preview: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: matyrobbrt/cloudflare-pr-previews@v1 | ||
with: | ||
gh_app_key: ${{ secrets.CLOUDFLARE_PAGES_DEPLOYMENTS_GH_APP_KEY }} | ||
gh_app_name: ${{ secrets.CLOUDFLARE_PAGES_DEPLOYMENTS_GH_APP_NAME }} | ||
project_name: 'neoforged-website-previews' | ||
env: | ||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_PAGES_API_TOKEN }} |