mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:35:42 +00:00
Use App Platform hosting for Eagle0pedia (#8397)
This commit is contained in:
@@ -1,40 +1,32 @@
|
||||
name: Eagle0pedia Deploy
|
||||
name: Eagle0pedia Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
paths:
|
||||
- 'docs/eagle0pedia/**'
|
||||
- 'ci/github_actions/deploy_eagle0pedia.sh'
|
||||
- 'ci/github_actions/ensure_bazel_installed.sh'
|
||||
- '.github/actions/setup-bazel/**'
|
||||
- '.github/workflows/eagle0pedia_deploy.yml'
|
||||
- '.github/workflows/eagle0pedia_build.yml'
|
||||
- 'MODULE.bazel'
|
||||
- 'MODULE.bazel.lock'
|
||||
- '.bazelrc'
|
||||
pull_request:
|
||||
paths:
|
||||
- 'docs/eagle0pedia/**'
|
||||
- 'ci/github_actions/deploy_eagle0pedia.sh'
|
||||
- 'ci/github_actions/ensure_bazel_installed.sh'
|
||||
- '.github/actions/setup-bazel/**'
|
||||
- '.github/workflows/eagle0pedia_deploy.yml'
|
||||
- '.github/workflows/eagle0pedia_build.yml'
|
||||
- 'MODULE.bazel'
|
||||
- 'MODULE.bazel.lock'
|
||||
- '.bazelrc'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
deploy:
|
||||
description: 'Deploy the built site to DigitalOcean Spaces'
|
||||
required: true
|
||||
default: 'true'
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || 'deploy' }}
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
jobs:
|
||||
@@ -91,29 +83,4 @@ jobs:
|
||||
name: eagle0pedia-dist
|
||||
path: eagle0pedia-dist/
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.deploy == 'true')
|
||||
environment: production
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Download static site artifact
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
name: eagle0pedia-dist
|
||||
path: eagle0pedia-dist
|
||||
|
||||
- name: Deploy to DigitalOcean Spaces
|
||||
env:
|
||||
EAGLE0PEDIA_SPACES_ACCESS_KEY: ${{ secrets.EAGLE0PEDIA_SPACES_ACCESS_KEY }}
|
||||
EAGLE0PEDIA_SPACES_SECRET_KEY: ${{ secrets.EAGLE0PEDIA_SPACES_SECRET_KEY }}
|
||||
DO_SPACES_ENDPOINT: ${{ vars.DO_SPACES_ENDPOINT || 'https://sfo3.digitaloceanspaces.com' }}
|
||||
EAGLE0PEDIA_SPACES_BUCKET: ${{ vars.EAGLE0PEDIA_SPACES_BUCKET }}
|
||||
run: ./ci/github_actions/deploy_eagle0pedia.sh eagle0pedia-dist
|
||||
retention-days: 3
|
||||
@@ -1,29 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SITE_DIR="${1:-bazel-bin/docs/eagle0pedia/dist}"
|
||||
DO_ENDPOINT="${DO_SPACES_ENDPOINT:-https://sfo3.digitaloceanspaces.com}"
|
||||
DO_BUCKET="${EAGLE0PEDIA_SPACES_BUCKET:?EAGLE0PEDIA_SPACES_BUCKET must be set}"
|
||||
|
||||
if [ ! -d "${SITE_DIR}" ]; then
|
||||
echo "ERROR: Eagle0pedia site output not found at ${SITE_DIR}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! command -v aws >/dev/null 2>&1; then
|
||||
echo "ERROR: aws CLI is required to deploy Eagle0pedia"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
export AWS_ACCESS_KEY_ID="${EAGLE0PEDIA_SPACES_ACCESS_KEY:?EAGLE0PEDIA_SPACES_ACCESS_KEY must be set}"
|
||||
export AWS_SECRET_ACCESS_KEY="${EAGLE0PEDIA_SPACES_SECRET_KEY:?EAGLE0PEDIA_SPACES_SECRET_KEY must be set}"
|
||||
|
||||
echo "Deploying Eagle0pedia from ${SITE_DIR}"
|
||||
echo "Target: s3://${DO_BUCKET}/"
|
||||
|
||||
aws s3 sync "${SITE_DIR}" "s3://${DO_BUCKET}/" \
|
||||
--endpoint-url "${DO_ENDPOINT}" \
|
||||
--acl public-read \
|
||||
--delete
|
||||
|
||||
echo "Eagle0pedia deploy complete"
|
||||
+19
-15
@@ -1,6 +1,7 @@
|
||||
# Eagle0pedia Site
|
||||
|
||||
Eagle0pedia is a Starlight static site built through Bazel.
|
||||
Eagle0pedia is a Starlight static site. CI validates it through Bazel, while
|
||||
DigitalOcean App Platform builds and hosts it directly as a static site.
|
||||
|
||||
## Local Build
|
||||
|
||||
@@ -16,29 +17,32 @@ bazel-bin/docs/eagle0pedia/dist
|
||||
|
||||
## Deployment
|
||||
|
||||
Eagle0pedia deploys from GitHub Actions. The workflow builds the Bazel target,
|
||||
archives the generated static site, and syncs it to a DigitalOcean Spaces
|
||||
bucket.
|
||||
|
||||
Required repository secrets:
|
||||
Eagle0pedia is hosted by DigitalOcean App Platform as a static site. Use these
|
||||
component settings:
|
||||
|
||||
```text
|
||||
EAGLE0PEDIA_SPACES_ACCESS_KEY
|
||||
EAGLE0PEDIA_SPACES_SECRET_KEY
|
||||
Resource type: Static Site
|
||||
Source directory: docs/eagle0pedia
|
||||
Build command: corepack enable && pnpm install --frozen-lockfile && pnpm build
|
||||
Output directory: dist
|
||||
HTTP route: /
|
||||
Domain: pedia.eagle0.net
|
||||
```
|
||||
|
||||
Required repository variables:
|
||||
The App Platform build uses the normal Starlight package scripts:
|
||||
|
||||
```text
|
||||
EAGLE0PEDIA_SPACES_BUCKET
|
||||
npm run build
|
||||
```
|
||||
|
||||
Optional repository variables:
|
||||
Set this App Platform environment variable:
|
||||
|
||||
```text
|
||||
DO_SPACES_ENDPOINT
|
||||
ASTRO_TELEMETRY_DISABLED=1
|
||||
```
|
||||
|
||||
`DO_SPACES_ENDPOINT` defaults to `https://sfo3.digitaloceanspaces.com`.
|
||||
Point `pedia.eagle0.net` at the Spaces CDN or serving endpoint for the
|
||||
configured bucket.
|
||||
CI still validates the Bazel build:
|
||||
|
||||
```text
|
||||
bazel build //docs/eagle0pedia:site
|
||||
```
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"packageManager": "pnpm@9.15.9",
|
||||
"scripts": {
|
||||
"build": "astro build",
|
||||
"dev": "astro dev",
|
||||
|
||||
Reference in New Issue
Block a user