-
Notifications
You must be signed in to change notification settings - Fork 1
Make public site deployment explicit #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,59 @@ | ||
| name: Deploy Public Site | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/workflows/deploy-public-site.yml" | ||
| - "website/**" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: secopsai-public-site-production | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd | ||
|
|
||
| - name: Set up Node.js 22 | ||
| uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 | ||
| with: | ||
| node-version: "22" | ||
|
|
||
| - name: Deploy reviewed website directory | ||
| env: | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| run: | | ||
| npx --yes wrangler@4.114.0 pages deploy website \ | ||
| --project-name website \ | ||
| --branch main \ | ||
| --commit-hash "${GITHUB_SHA}" \ | ||
| --commit-message "Deploy SecOpsAI public site ${GITHUB_SHA}" | ||
|
|
||
| - name: Verify public installer contents | ||
| run: | | ||
| set -euo pipefail | ||
| verify_installer() { | ||
| installer="$1" | ||
| marker="$2" | ||
| output="${RUNNER_TEMP}/${installer}" | ||
| curl -fsSL --retry 8 --retry-all-errors --retry-delay 5 \ | ||
| "https://secopsai.dev/${installer}?release=${GITHUB_SHA}" \ | ||
| -o "$output" | ||
| if [ "$(sed -n '1p' "$output")" != "#!/bin/sh" ]; then | ||
| echo "${installer} did not return a POSIX shell installer" >&2 | ||
| exit 1 | ||
| fi | ||
| grep -F "$marker" "$output" >/dev/null | ||
| } | ||
| verify_installer "install.sh" 'SECOPSAI_INSTALL_REF:-v1.0.0' | ||
| verify_installer "install-hermes.sh" 'MIN_VERSION="0.18.2"' | ||
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an installer changes without changing these release markers—for example, a fix to
install.shwhile remaining on v1.0.0—the previous deployment has the same shebang and marker, so this check succeeds even if the apex domain still serves stale content or points at the wrong deployment. The SHA query only makes the request URL unique; it does not prove the response came from that commit. Compare the downloaded body withwebsite/${installer}or its digest instead.Useful? React with 👍 / 👎.