Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ name: Deploy static site to GitHub Pages
on:
push:
branches: ["main"]
paths-ignore:
- 'research/**'
- 'interview/**'
workflow_dispatch:

permissions:
contents: write
contents: read
pages: write
id-token: write

Expand Down Expand Up @@ -69,14 +72,6 @@ jobs:
mkdir -p interview
cp -r external/InterviewGuide/dist/* interview/

- name: Commit generated sub-sites if changed
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add research/ interview/
git diff --quiet && git diff --staged --quiet || git commit -m "Auto-update external sites"
git push || echo "No changes to push"

- uses: actions/upload-pages-artifact@v3
with:
path: .
Expand All @@ -88,5 +83,9 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
with:
enablement: true
- id: deployment
uses: actions/deploy-pages@v4
4 changes: 0 additions & 4 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
name: Deploy static content to Pages

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

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

Expand Down
16 changes: 16 additions & 0 deletions tests/interviewguide_external_integration.test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ set -euo pipefail

ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
WORKFLOW_FILE="$ROOT_DIR/.github/workflows/deploy-pages.yml"
STATIC_WORKFLOW_FILE="$ROOT_DIR/.github/workflows/static.yml"
INDEX_FILE="$ROOT_DIR/index.html"
GITIGNORE_FILE="$ROOT_DIR/.gitignore"
EXTERNAL_DIR="$ROOT_DIR/external/InterviewGuide"
Expand All @@ -11,6 +12,21 @@ grep -q "external/InterviewGuide/package-lock.json" "$WORKFLOW_FILE"
grep -q "working-directory: external/InterviewGuide" "$WORKFLOW_FILE"
grep -q "BASE_PATH: /AgentGuide/interview" "$WORKFLOW_FILE"
grep -q "cp -r external/InterviewGuide/dist/\\* interview/" "$WORKFLOW_FILE"
grep -q "paths-ignore:" "$WORKFLOW_FILE"
grep -q "'research/\\*\\*'" "$WORKFLOW_FILE"
grep -q "'interview/\\*\\*'" "$WORKFLOW_FILE"
grep -q "uses: actions/configure-pages@v5" "$WORKFLOW_FILE"
grep -q "enablement: true" "$WORKFLOW_FILE"
if grep -Eq "git add .*research/.*interview/" "$WORKFLOW_FILE"; then
echo "workflow should not auto-commit generated research/interview directories"
exit 1
fi

# avoid dual-pages workflows both auto-triggering on push
if grep -q "^ push:" "$STATIC_WORKFLOW_FILE"; then
echo "static.yml should not auto-trigger on push"
exit 1
fi

grep -q "external/InterviewGuide/dist/" "$GITIGNORE_FILE"
grep -q "external/InterviewGuide/node_modules/" "$GITIGNORE_FILE"
Expand Down