Skip to content

Commit

Permalink
Update deploy.yml to run build on PRs
Browse files Browse the repository at this point in the history
Include Posthog API key as an env variable.
  • Loading branch information
fwextensions committed Nov 28, 2024
1 parent 021fa06 commit aaf3d05
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name: Deploy to GitHub Pages

on:
# Runs on pushes targeting the default branch
# Runs on pushes and PRs targeting the default branch
push:
branches: ["main"]
pull_request:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -22,7 +24,7 @@ concurrency:

env:
BUILD_PATH: "." # default value when not using subfolders
# BUILD_PATH: subfolder
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}

jobs:
build:
Expand Down Expand Up @@ -74,6 +76,8 @@ jobs:
path: ${{ env.BUILD_PATH }}/dist

deploy:
# Only deploy from the main branch, or when manually triggered
if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand Down

0 comments on commit aaf3d05

Please sign in to comment.