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 ec46cea
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
# Runs on pushes 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 @@ -62,6 +64,8 @@ jobs:
- name: Install dependencies
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
working-directory: ${{ env.BUILD_PATH }}
- name: key
run: echo "${{ env.POSTHOG_API_KEY }}"
- name: Build with Astro
run: |
${{ steps.detect-package-manager.outputs.runner }} astro build \
Expand All @@ -74,6 +78,7 @@ jobs:
path: ${{ env.BUILD_PATH }}/dist

deploy:
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 ec46cea

Please sign in to comment.