Skip to content

Commit

Permalink
Merge pull request #1 from neoforged/main
Browse files Browse the repository at this point in the history
Add PR preview deployments
  • Loading branch information
lukebemish authored Sep 26, 2023
2 parents 87075a2 + fbcd28c commit 446d24e
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-pr.yml
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/
24 changes: 24 additions & 0 deletions .github/workflows/preview-pr.yml
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 }}

1 comment on commit 446d24e

@neoforged-pages-deployments
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploying with Cloudflare Pages

Name Result
Last commit: 446d24e9d48f98fa12aa5dbcb8397bd8bc597970
Status: ✅ Deploy successful!
Preview URL: https://80b2185b.neoforged-website-previews.pages.dev
PR Preview URL: https://pr-4.neoforged-website-previews.pages.dev

Please sign in to comment.